From fb0a5a933578d466369bbe1fc89694ced2b040b9 Mon Sep 17 00:00:00 2001 From: wyfcyx Date: Fri, 10 May 2024 13:32:15 +0000 Subject: [PATCH] deploy: 64d025bf36271f07d86c404bb044925fab2cd768 --- ch5/help.html | 3 +- ch5/os/all.html | 3 +- ch5/os/board/constant.CLOCK_FREQ.html | 3 +- ch5/os/board/constant.MEMORY_END.html | 3 +- ch5/os/board/constant.MMIO.html | 3 +- ch5/os/board/index.html | 5 +- ch5/os/config/constant.KERNEL_HEAP_SIZE.html | 3 +- ch5/os/config/constant.KERNEL_STACK_SIZE.html | 3 +- ch5/os/config/constant.PAGE_SIZE.html | 3 +- ch5/os/config/constant.PAGE_SIZE_BITS.html | 3 +- ch5/os/config/constant.TRAMPOLINE.html | 3 +- ch5/os/config/constant.TRAP_CONTEXT.html | 3 +- ch5/os/config/constant.USER_STACK_SIZE.html | 3 +- ch5/os/config/index.html | 5 +- ch5/os/console/fn.print.html | 3 +- ch5/os/console/index.html | 5 +- ch5/os/console/struct.Stdout.html | 17 +- ch5/os/fn.clear_bss.html | 3 +- ch5/os/fn.rust_main.html | 3 +- ch5/os/index.html | 6 +- ch5/os/lang_items/fn.panic.html | 3 +- ch5/os/lang_items/index.html | 5 +- ch5/os/loader/fn.get_app_data.html | 3 +- ch5/os/loader/fn.get_app_data_by_name.html | 3 +- ch5/os/loader/fn.get_num_app.html | 3 +- ch5/os/loader/fn.list_apps.html | 3 +- ch5/os/loader/index.html | 5 +- ch5/os/loader/struct.APP_NAMES.html | 1220 +++++++++-------- ch5/os/macro.print.html | 3 +- ch5/os/macro.println.html | 3 +- ch5/os/mm/address/constant.PA_WIDTH_SV39.html | 3 +- .../mm/address/constant.PPN_WIDTH_SV39.html | 3 +- ch5/os/mm/address/constant.VA_WIDTH_SV39.html | 3 +- .../mm/address/constant.VPN_WIDTH_SV39.html | 3 +- ch5/os/mm/address/index.html | 5 +- ch5/os/mm/address/struct.PhysAddr.html | 31 +- ch5/os/mm/address/struct.PhysPageNum.html | 29 +- ch5/os/mm/address/struct.SimpleRange.html | 18 +- .../address/struct.SimpleRangeIterator.html | 142 +- ch5/os/mm/address/struct.VirtAddr.html | 29 +- ch5/os/mm/address/struct.VirtPageNum.html | 29 +- ch5/os/mm/address/trait.StepByOne.html | 3 +- ch5/os/mm/address/type.VPNRange.html | 3 +- ch5/os/mm/fn.frame_alloc.html | 3 +- ch5/os/mm/fn.init.html | 3 +- ch5/os/mm/fn.remap_test.html | 3 +- ch5/os/mm/fn.translated_byte_buffer.html | 3 +- ch5/os/mm/fn.translated_refmut.html | 3 +- ch5/os/mm/fn.translated_str.html | 3 +- ch5/os/mm/frame_allocator/fn.frame_alloc.html | 3 +- .../fn.frame_allocator_test.html | 3 +- .../mm/frame_allocator/fn.frame_dealloc.html | 3 +- .../fn.init_frame_allocator.html | 3 +- ch5/os/mm/frame_allocator/index.html | 5 +- .../struct.FRAME_ALLOCATOR.html | 17 +- .../frame_allocator/struct.FrameTracker.html | 17 +- .../struct.StackFrameAllocator.html | 17 +- .../frame_allocator/trait.FrameAllocator.html | 3 +- .../type.FrameAllocatorImpl.html | 3 +- .../heap_allocator/fn.handle_alloc_error.html | 3 +- ch5/os/mm/heap_allocator/fn.heap_test.html | 3 +- ch5/os/mm/heap_allocator/fn.init_heap.html | 3 +- ch5/os/mm/heap_allocator/index.html | 5 +- .../heap_allocator/static.HEAP_ALLOCATOR.html | 3 +- .../mm/heap_allocator/static.HEAP_SPACE.html | 3 +- ch5/os/mm/index.html | 7 +- ch5/os/mm/memory_set/enum.MapType.html | 19 +- ch5/os/mm/memory_set/fn.ebss.html | 3 +- ch5/os/mm/memory_set/fn.edata.html | 3 +- ch5/os/mm/memory_set/fn.ekernel.html | 3 +- ch5/os/mm/memory_set/fn.erodata.html | 3 +- ch5/os/mm/memory_set/fn.etext.html | 3 +- ch5/os/mm/memory_set/fn.remap_test.html | 3 +- ch5/os/mm/memory_set/fn.sbss_with_stack.html | 3 +- ch5/os/mm/memory_set/fn.sdata.html | 3 +- ch5/os/mm/memory_set/fn.srodata.html | 3 +- ch5/os/mm/memory_set/fn.stext.html | 3 +- ch5/os/mm/memory_set/fn.strampoline.html | 3 +- ch5/os/mm/memory_set/index.html | 5 +- ch5/os/mm/memory_set/struct.KERNEL_SPACE.html | 17 +- ch5/os/mm/memory_set/struct.MapArea.html | 17 +- .../mm/memory_set/struct.MapPermission.html | 41 +- ch5/os/mm/memory_set/struct.MemorySet.html | 17 +- .../page_table/fn.translated_byte_buffer.html | 3 +- .../mm/page_table/fn.translated_refmut.html | 3 +- ch5/os/mm/page_table/fn.translated_str.html | 3 +- ch5/os/mm/page_table/index.html | 5 +- ch5/os/mm/page_table/struct.PTEFlags.html | 43 +- ch5/os/mm/page_table/struct.PageTable.html | 17 +- .../mm/page_table/struct.PageTableEntry.html | 17 +- ch5/os/mm/struct.FrameTracker.html | 17 +- ch5/os/mm/struct.KERNEL_SPACE.html | 17 +- ch5/os/mm/struct.MapPermission.html | 41 +- ch5/os/mm/struct.MemorySet.html | 17 +- ch5/os/mm/struct.PageTableEntry.html | 17 +- ch5/os/mm/struct.PhysAddr.html | 31 +- ch5/os/mm/struct.PhysPageNum.html | 29 +- ch5/os/mm/struct.VirtAddr.html | 29 +- ch5/os/mm/struct.VirtPageNum.html | 29 +- ch5/os/sbi/fn.console_getchar.html | 3 +- ch5/os/sbi/fn.console_putchar.html | 3 +- ch5/os/sbi/fn.set_timer.html | 3 +- ch5/os/sbi/fn.shutdown.html | 3 +- ch5/os/sbi/index.html | 5 +- ch5/os/sync/index.html | 5 +- ch5/os/sync/struct.UPSafeCell.html | 17 +- ch5/os/sync/up/index.html | 5 +- ch5/os/sync/up/struct.UPSafeCell.html | 17 +- ch5/os/syscall/constant.SYSCALL_EXEC.html | 3 +- ch5/os/syscall/constant.SYSCALL_EXIT.html | 3 +- ch5/os/syscall/constant.SYSCALL_FORK.html | 3 +- ch5/os/syscall/constant.SYSCALL_GETPID.html | 3 +- ch5/os/syscall/constant.SYSCALL_GET_TIME.html | 3 +- ch5/os/syscall/constant.SYSCALL_READ.html | 3 +- ch5/os/syscall/constant.SYSCALL_WAITPID.html | 3 +- ch5/os/syscall/constant.SYSCALL_WRITE.html | 3 +- ch5/os/syscall/constant.SYSCALL_YIELD.html | 3 +- ch5/os/syscall/fn.syscall.html | 3 +- ch5/os/syscall/fs/constant.FD_STDIN.html | 3 +- ch5/os/syscall/fs/constant.FD_STDOUT.html | 3 +- ch5/os/syscall/fs/fn.sys_read.html | 3 +- ch5/os/syscall/fs/fn.sys_write.html | 3 +- ch5/os/syscall/fs/index.html | 5 +- ch5/os/syscall/index.html | 5 +- ch5/os/syscall/process/fn.sys_exec.html | 3 +- ch5/os/syscall/process/fn.sys_exit.html | 3 +- ch5/os/syscall/process/fn.sys_fork.html | 3 +- ch5/os/syscall/process/fn.sys_get_time.html | 3 +- ch5/os/syscall/process/fn.sys_getpid.html | 3 +- ch5/os/syscall/process/fn.sys_waitpid.html | 3 +- ch5/os/syscall/process/fn.sys_yield.html | 3 +- ch5/os/syscall/process/index.html | 3 +- ch5/os/task/constant.IDLE_PID.html | 3 +- ch5/os/task/context/index.html | 5 +- ch5/os/task/context/struct.TaskContext.html | 17 +- ch5/os/task/fn.add_initproc.html | 3 +- ch5/os/task/fn.add_task.html | 3 +- ch5/os/task/fn.current_task.html | 3 +- ch5/os/task/fn.current_trap_cx.html | 3 +- ch5/os/task/fn.current_user_token.html | 3 +- ch5/os/task/fn.exit_current_and_run_next.html | 3 +- ch5/os/task/fn.fetch_task.html | 3 +- ch5/os/task/fn.pid_alloc.html | 3 +- ch5/os/task/fn.run_tasks.html | 3 +- ch5/os/task/fn.schedule.html | 3 +- .../task/fn.suspend_current_and_run_next.html | 3 +- ch5/os/task/fn.take_current_task.html | 3 +- ch5/os/task/index.html | 5 +- ch5/os/task/manager/fn.add_task.html | 3 +- ch5/os/task/manager/fn.fetch_task.html | 3 +- ch5/os/task/manager/index.html | 5 +- ch5/os/task/manager/struct.TASK_MANAGER.html | 17 +- ch5/os/task/manager/struct.TaskManager.html | 17 +- ch5/os/task/pid/fn.kernel_stack_position.html | 3 +- ch5/os/task/pid/fn.pid_alloc.html | 3 +- ch5/os/task/pid/index.html | 5 +- ch5/os/task/pid/struct.KernelStack.html | 17 +- ch5/os/task/pid/struct.PID_ALLOCATOR.html | 17 +- ch5/os/task/pid/struct.PidAllocator.html | 17 +- ch5/os/task/pid/struct.PidHandle.html | 17 +- ch5/os/task/processor/fn.current_task.html | 3 +- ch5/os/task/processor/fn.current_trap_cx.html | 3 +- .../task/processor/fn.current_user_token.html | 3 +- ch5/os/task/processor/fn.run_tasks.html | 3 +- ch5/os/task/processor/fn.schedule.html | 3 +- .../task/processor/fn.take_current_task.html | 3 +- ch5/os/task/processor/index.html | 5 +- ch5/os/task/processor/struct.PROCESSOR.html | 17 +- ch5/os/task/processor/struct.Processor.html | 17 +- ch5/os/task/struct.INITPROC.html | 17 +- ch5/os/task/struct.KernelStack.html | 17 +- ch5/os/task/struct.PidAllocator.html | 17 +- ch5/os/task/struct.PidHandle.html | 17 +- ch5/os/task/struct.Processor.html | 17 +- ch5/os/task/struct.TaskContext.html | 17 +- ch5/os/task/struct.TaskManager.html | 17 +- ch5/os/task/switch/fn.__switch.html | 3 +- ch5/os/task/switch/index.html | 5 +- ch5/os/task/task/enum.TaskStatus.html | 21 +- ch5/os/task/task/index.html | 5 +- ch5/os/task/task/struct.TaskControlBlock.html | 17 +- .../task/struct.TaskControlBlockInner.html | 17 +- ch5/os/timer/constant.MSEC_PER_SEC.html | 3 +- ch5/os/timer/constant.TICKS_PER_SEC.html | 3 +- ch5/os/timer/fn.get_time.html | 3 +- ch5/os/timer/fn.get_time_ms.html | 3 +- ch5/os/timer/fn.set_next_trigger.html | 3 +- ch5/os/timer/index.html | 5 +- ch5/os/trap/context/index.html | 5 +- ch5/os/trap/context/struct.TrapContext.html | 17 +- ch5/os/trap/fn.enable_timer_interrupt.html | 3 +- ch5/os/trap/fn.init.html | 3 +- ch5/os/trap/fn.set_kernel_trap_entry.html | 3 +- ch5/os/trap/fn.set_user_trap_entry.html | 3 +- ch5/os/trap/fn.trap_from_kernel.html | 3 +- ch5/os/trap/fn.trap_handler.html | 3 +- ch5/os/trap/fn.trap_return.html | 3 +- ch5/os/trap/index.html | 5 +- ch5/os/trap/struct.TrapContext.html | 17 +- ch5/search-index.js | 2 +- ch5/search.desc/os/os-desc-0-.js | 1 + ch5/settings.html | 3 +- ch5/src/os/boards/qemu.rs.html | 4 +- ch5/src/os/config.rs.html | 4 +- ch5/src/os/console.rs.html | 8 +- ch5/src/os/lang_items.rs.html | 4 +- ch5/src/os/loader.rs.html | 6 +- ch5/src/os/main.rs.html | 4 +- ch5/src/os/mm/address.rs.html | 4 +- ch5/src/os/mm/frame_allocator.rs.html | 6 +- ch5/src/os/mm/heap_allocator.rs.html | 4 +- ch5/src/os/mm/memory_set.rs.html | 8 +- ch5/src/os/mm/mod.rs.html | 4 +- ch5/src/os/mm/page_table.rs.html | 6 +- ch5/src/os/sbi.rs.html | 4 +- ch5/src/os/sync/mod.rs.html | 4 +- ch5/src/os/sync/up.rs.html | 4 +- ch5/src/os/syscall/fs.rs.html | 4 +- ch5/src/os/syscall/mod.rs.html | 4 +- ch5/src/os/syscall/process.rs.html | 4 +- ch5/src/os/task/context.rs.html | 4 +- ch5/src/os/task/manager.rs.html | 6 +- ch5/src/os/task/mod.rs.html | 6 +- ch5/src/os/task/pid.rs.html | 6 +- ch5/src/os/task/processor.rs.html | 6 +- ch5/src/os/task/switch.rs.html | 4 +- ch5/src/os/task/task.rs.html | 8 +- ch5/src/os/timer.rs.html | 4 +- ch5/src/os/trap/context.rs.html | 4 +- ch5/src/os/trap/mod.rs.html | 4 +- .../clipboard-7571035ce49a181d.svg | 1 - .../favicon-16x16-8b506e7a72182f1c.png | Bin 715 -> 0 bytes ch5/static.files/main-0b2e2def73e61cbe.js | 11 - ch5/static.files/main-20a3ad099b048cf2.js | 11 + .../noscript-04d5337699b92874.css | 1 - .../noscript-09095024cf37855e.css | 1 + ...cc83f.css => rustdoc-b21aa549bf6d91ff.css} | 32 +- ch5/static.files/search-bf21c90c8c1d92b1.js | 5 + ch5/static.files/search-dd67cee4cfa65049.js | 5 - ch5/static.files/storage-e32f0c247825364d.js | 1 + ch5/static.files/storage-f2adc0d6ca4d09fb.js | 1 - ch5/static.files/wheel-7b819b6101059cd0.svg | 1 - ch5/trait.impl/core/clone/trait.Clone.js | 2 +- ch5/trait.impl/core/cmp/trait.Eq.js | 2 +- ch5/trait.impl/core/cmp/trait.Ord.js | 2 +- ch5/trait.impl/core/cmp/trait.PartialEq.js | 2 +- ch5/trait.impl/core/cmp/trait.PartialOrd.js | 2 +- ch5/trait.impl/core/convert/trait.From.js | 2 +- ch5/trait.impl/core/fmt/trait.Debug.js | 2 +- ch5/trait.impl/core/fmt/trait.Octal.js | 2 +- .../core/iter/traits/collect/trait.Extend.js | 2 +- ch5/trait.impl/core/marker/trait.Copy.js | 2 +- ch5/trait.impl/core/marker/trait.Freeze.js | 2 +- ch5/trait.impl/core/marker/trait.Send.js | 2 +- .../core/marker/trait.StructuralEq.js | 3 - .../core/marker/trait.StructuralPartialEq.js | 2 +- ch5/trait.impl/core/marker/trait.Sync.js | 2 +- ch5/trait.impl/core/marker/trait.Unpin.js | 2 +- ch5/trait.impl/core/ops/arith/trait.Sub.js | 2 +- ch5/trait.impl/core/ops/bit/trait.BitAnd.js | 2 +- .../core/ops/bit/trait.BitAndAssign.js | 2 +- .../core/ops/bit/trait.BitOrAssign.js | 2 +- ch5/trait.impl/core/ops/deref/trait.Deref.js | 2 +- .../panic/unwind_safe/trait.RefUnwindSafe.js | 2 +- .../panic/unwind_safe/trait.UnwindSafe.js | 2 +- .../lazy_static/trait.LazyStatic.js | 2 +- .../os/mm/address/struct.SimpleRange.js | 2 +- .../struct.StackFrameAllocator.js | 2 +- 268 files changed, 1466 insertions(+), 1678 deletions(-) create mode 100644 ch5/search.desc/os/os-desc-0-.js delete mode 100644 ch5/static.files/clipboard-7571035ce49a181d.svg delete mode 100644 ch5/static.files/favicon-16x16-8b506e7a72182f1c.png delete mode 100644 ch5/static.files/main-0b2e2def73e61cbe.js create mode 100644 ch5/static.files/main-20a3ad099b048cf2.js delete mode 100644 ch5/static.files/noscript-04d5337699b92874.css create mode 100644 ch5/static.files/noscript-09095024cf37855e.css rename ch5/static.files/{rustdoc-4e54bb2b497cc83f.css => rustdoc-b21aa549bf6d91ff.css} (56%) create mode 100644 ch5/static.files/search-bf21c90c8c1d92b1.js delete mode 100644 ch5/static.files/search-dd67cee4cfa65049.js create mode 100644 ch5/static.files/storage-e32f0c247825364d.js delete mode 100644 ch5/static.files/storage-f2adc0d6ca4d09fb.js delete mode 100644 ch5/static.files/wheel-7b819b6101059cd0.svg delete mode 100644 ch5/trait.impl/core/marker/trait.StructuralEq.js diff --git a/ch5/help.html b/ch5/help.html index b36e5005..43c781d7 100644 --- a/ch5/help.html +++ b/ch5/help.html @@ -1,2 +1 @@ -Help -

Rustdoc help

Back
\ No newline at end of file +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/ch5/os/all.html b/ch5/os/all.html index b38f4981..215a7224 100644 --- a/ch5/os/all.html +++ b/ch5/os/all.html @@ -1,2 +1 @@ -List of all items in this crate -

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

Statics

Constants

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

Statics

Constants

\ No newline at end of file diff --git a/ch5/os/board/constant.CLOCK_FREQ.html b/ch5/os/board/constant.CLOCK_FREQ.html index f1fe0139..b9979416 100644 --- a/ch5/os/board/constant.CLOCK_FREQ.html +++ b/ch5/os/board/constant.CLOCK_FREQ.html @@ -1,2 +1 @@ -CLOCK_FREQ in os::board - Rust -

Constant os::board::CLOCK_FREQ

source ·
pub const CLOCK_FREQ: usize = 12500000;
\ No newline at end of file +CLOCK_FREQ in os::board - Rust

Constant os::board::CLOCK_FREQ

source ·
pub const CLOCK_FREQ: usize = 12500000;
\ No newline at end of file diff --git a/ch5/os/board/constant.MEMORY_END.html b/ch5/os/board/constant.MEMORY_END.html index 11491d0a..ce69a5fe 100644 --- a/ch5/os/board/constant.MEMORY_END.html +++ b/ch5/os/board/constant.MEMORY_END.html @@ -1,2 +1 @@ -MEMORY_END in os::board - Rust -

Constant os::board::MEMORY_END

source ·
pub const MEMORY_END: usize = 0x8800_0000;
\ No newline at end of file +MEMORY_END in os::board - Rust

Constant os::board::MEMORY_END

source ·
pub const MEMORY_END: usize = 0x8800_0000;
\ No newline at end of file diff --git a/ch5/os/board/constant.MMIO.html b/ch5/os/board/constant.MMIO.html index 8a1c3bf6..aca22448 100644 --- a/ch5/os/board/constant.MMIO.html +++ b/ch5/os/board/constant.MMIO.html @@ -1,2 +1 @@ -MMIO in os::board - Rust -

Constant os::board::MMIO

source ·
pub const MMIO: &[(usize, usize)];
\ No newline at end of file +MMIO in os::board - Rust

Constant os::board::MMIO

source ·
pub const MMIO: &[(usize, usize)];
\ No newline at end of file diff --git a/ch5/os/board/index.html b/ch5/os/board/index.html index d22fbb7e..7a58345d 100644 --- a/ch5/os/board/index.html +++ b/ch5/os/board/index.html @@ -1,3 +1,2 @@ -os::board - Rust -

Module os::board

source ·
Expand description

Constants used in rCore for qemu

-

Constants

\ No newline at end of file +os::board - Rust

Module os::board

source ·
Expand description

Constants used in rCore for qemu

+

Constants§

\ No newline at end of file diff --git a/ch5/os/config/constant.KERNEL_HEAP_SIZE.html b/ch5/os/config/constant.KERNEL_HEAP_SIZE.html index a8d9ed9f..f2bf97e0 100644 --- a/ch5/os/config/constant.KERNEL_HEAP_SIZE.html +++ b/ch5/os/config/constant.KERNEL_HEAP_SIZE.html @@ -1,2 +1 @@ -KERNEL_HEAP_SIZE in os::config - Rust -

Constant os::config::KERNEL_HEAP_SIZE

source ·
pub const KERNEL_HEAP_SIZE: usize = 0x20_0000;
\ No newline at end of file +KERNEL_HEAP_SIZE in os::config - Rust

Constant os::config::KERNEL_HEAP_SIZE

source ·
pub const KERNEL_HEAP_SIZE: usize = 0x20_0000;
\ No newline at end of file diff --git a/ch5/os/config/constant.KERNEL_STACK_SIZE.html b/ch5/os/config/constant.KERNEL_STACK_SIZE.html index fd26ffe5..f9cb4647 100644 --- a/ch5/os/config/constant.KERNEL_STACK_SIZE.html +++ b/ch5/os/config/constant.KERNEL_STACK_SIZE.html @@ -1,2 +1 @@ -KERNEL_STACK_SIZE in os::config - Rust -

Constant os::config::KERNEL_STACK_SIZE

source ·
pub const KERNEL_STACK_SIZE: usize = _; // 8_192usize
\ No newline at end of file +KERNEL_STACK_SIZE in os::config - Rust

Constant os::config::KERNEL_STACK_SIZE

source ·
pub const KERNEL_STACK_SIZE: usize = _; // 8_192usize
\ No newline at end of file diff --git a/ch5/os/config/constant.PAGE_SIZE.html b/ch5/os/config/constant.PAGE_SIZE.html index 1d78f6fb..93a41186 100644 --- a/ch5/os/config/constant.PAGE_SIZE.html +++ b/ch5/os/config/constant.PAGE_SIZE.html @@ -1,2 +1 @@ -PAGE_SIZE in os::config - Rust -

Constant os::config::PAGE_SIZE

source ·
pub const PAGE_SIZE: usize = 0x1000;
\ No newline at end of file +PAGE_SIZE in os::config - Rust

Constant os::config::PAGE_SIZE

source ·
pub const PAGE_SIZE: usize = 0x1000;
\ No newline at end of file diff --git a/ch5/os/config/constant.PAGE_SIZE_BITS.html b/ch5/os/config/constant.PAGE_SIZE_BITS.html index dd34acf3..57d5a80b 100644 --- a/ch5/os/config/constant.PAGE_SIZE_BITS.html +++ b/ch5/os/config/constant.PAGE_SIZE_BITS.html @@ -1,2 +1 @@ -PAGE_SIZE_BITS in os::config - Rust -

Constant os::config::PAGE_SIZE_BITS

source ·
pub const PAGE_SIZE_BITS: usize = 0xc;
\ No newline at end of file +PAGE_SIZE_BITS in os::config - Rust

Constant os::config::PAGE_SIZE_BITS

source ·
pub const PAGE_SIZE_BITS: usize = 0xc;
\ No newline at end of file diff --git a/ch5/os/config/constant.TRAMPOLINE.html b/ch5/os/config/constant.TRAMPOLINE.html index 1d53fe5c..956736b9 100644 --- a/ch5/os/config/constant.TRAMPOLINE.html +++ b/ch5/os/config/constant.TRAMPOLINE.html @@ -1,2 +1 @@ -TRAMPOLINE in os::config - Rust -

Constant os::config::TRAMPOLINE

source ·
pub const TRAMPOLINE: usize = _; // 18_446_744_073_709_547_520usize
\ No newline at end of file +TRAMPOLINE in os::config - Rust

Constant os::config::TRAMPOLINE

source ·
pub const TRAMPOLINE: usize = _; // 18_446_744_073_709_547_520usize
\ No newline at end of file diff --git a/ch5/os/config/constant.TRAP_CONTEXT.html b/ch5/os/config/constant.TRAP_CONTEXT.html index 8bde7cac..e8342a8f 100644 --- a/ch5/os/config/constant.TRAP_CONTEXT.html +++ b/ch5/os/config/constant.TRAP_CONTEXT.html @@ -1,2 +1 @@ -TRAP_CONTEXT in os::config - Rust -

Constant os::config::TRAP_CONTEXT

source ·
pub const TRAP_CONTEXT: usize = _; // 18_446_744_073_709_543_424usize
\ No newline at end of file +TRAP_CONTEXT in os::config - Rust

Constant os::config::TRAP_CONTEXT

source ·
pub const TRAP_CONTEXT: usize = _; // 18_446_744_073_709_543_424usize
\ No newline at end of file diff --git a/ch5/os/config/constant.USER_STACK_SIZE.html b/ch5/os/config/constant.USER_STACK_SIZE.html index 81b6f32f..9e717e28 100644 --- a/ch5/os/config/constant.USER_STACK_SIZE.html +++ b/ch5/os/config/constant.USER_STACK_SIZE.html @@ -1,2 +1 @@ -USER_STACK_SIZE in os::config - Rust -

Constant os::config::USER_STACK_SIZE

source ·
pub const USER_STACK_SIZE: usize = _; // 8_192usize
\ No newline at end of file +USER_STACK_SIZE in os::config - Rust

Constant os::config::USER_STACK_SIZE

source ·
pub const USER_STACK_SIZE: usize = _; // 8_192usize
\ No newline at end of file diff --git a/ch5/os/config/index.html b/ch5/os/config/index.html index 843a5f61..7b7e239b 100644 --- a/ch5/os/config/index.html +++ b/ch5/os/config/index.html @@ -1,3 +1,2 @@ -os::config - Rust -

Module os::config

source ·
Expand description

Constants used in rCore

-

Re-exports

Constants

\ No newline at end of file +os::config - Rust

Module os::config

source ·
Expand description

Constants used in rCore

+

Re-exports§

Constants§

\ No newline at end of file diff --git a/ch5/os/console/fn.print.html b/ch5/os/console/fn.print.html index 00ed8511..caba2d62 100644 --- a/ch5/os/console/fn.print.html +++ b/ch5/os/console/fn.print.html @@ -1,2 +1 @@ -print in os::console - Rust -

Function os::console::print

source ·
pub fn print(args: Arguments<'_>)
\ No newline at end of file +print in os::console - Rust

Function os::console::print

source ·
pub fn print(args: Arguments<'_>)
\ No newline at end of file diff --git a/ch5/os/console/index.html b/ch5/os/console/index.html index 35f87847..e1135dfc 100644 --- a/ch5/os/console/index.html +++ b/ch5/os/console/index.html @@ -1,3 +1,2 @@ -os::console - Rust -

Module os::console

source ·
Expand description

SBI console driver, for text output

-

Structs

Functions

\ No newline at end of file +os::console - Rust

Module os::console

source ·
Expand description

SBI console driver, for text output

+

Structs§

Functions§

\ No newline at end of file diff --git a/ch5/os/console/struct.Stdout.html b/ch5/os/console/struct.Stdout.html index 13677ad6..93013685 100644 --- a/ch5/os/console/struct.Stdout.html +++ b/ch5/os/console/struct.Stdout.html @@ -1,13 +1,12 @@ -Stdout in os::console - Rust -

Struct os::console::Stdout

source ·
struct Stdout;

Trait Implementations§

source§

impl Write for Stdout

source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write -succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +Stdout in os::console - Rust

Struct os::console::Stdout

source ·
struct Stdout;

Trait Implementations§

source§

impl Write for Stdout

source§

fn write_str(&mut self, s: &str) -> Result

Writes a string slice into this writer, returning whether the write +succeeded. Read more
1.1.0 · source§

fn write_char(&mut self, c: char) -> Result<(), Error>

Writes a char into this writer, returning whether the write succeeded. Read more
1.0.0 · source§

fn write_fmt(&mut self, args: Arguments<'_>) -> Result<(), Error>

Glue for usage of the write! macro with implementors of this trait. Read more

Auto Trait Implementations§

§

impl Freeze for Stdout

§

impl RefUnwindSafe for Stdout

§

impl Send for Stdout

§

impl Sync for Stdout

§

impl Unpin for Stdout

§

impl UnwindSafe for Stdout

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/fn.clear_bss.html b/ch5/os/fn.clear_bss.html index 3a848897..1e3e288b 100644 --- a/ch5/os/fn.clear_bss.html +++ b/ch5/os/fn.clear_bss.html @@ -1,3 +1,2 @@ -clear_bss in os - Rust -

Function os::clear_bss

source ·
pub(crate) fn clear_bss()
Expand description

clear BSS segment

+clear_bss in os - Rust

Function os::clear_bss

source ·
pub(crate) fn clear_bss()
Expand description

clear BSS segment

\ No newline at end of file diff --git a/ch5/os/fn.rust_main.html b/ch5/os/fn.rust_main.html index a3564d72..75c6cc57 100644 --- a/ch5/os/fn.rust_main.html +++ b/ch5/os/fn.rust_main.html @@ -1,4 +1,3 @@ -rust_main in os - Rust -

Function os::rust_main

source ·
#[no_mangle]
+rust_main in os - Rust

Function os::rust_main

source ·
#[no_mangle]
 pub fn rust_main() -> !
Expand description

the rust entry-point of os

\ No newline at end of file diff --git a/ch5/os/index.html b/ch5/os/index.html index 8c0fc966..f83a10cf 100644 --- a/ch5/os/index.html +++ b/ch5/os/index.html @@ -1,6 +1,4 @@ -os - Rust -

Crate os

source ·
Expand description

The main module and entrypoint

+os - Rust

Crate os

source ·
Expand description

The main module and entrypoint

Various facilities of the kernels are implemented as submodules. The most important ones are:

    @@ -16,4 +14,4 @@ initialize various pieces of functionality. (See its source code for details.)

    We then call task::run_tasks() and for the first time go to userspace.

    -

Modules

  • board 🔒
    Constants used in rCore for qemu
  • config 🔒
    Constants used in rCore
  • console 🔒
    SBI console driver, for text output
  • lang_items 🔒
    The panic handler
  • loader 🔒
    Loading user applications into memory
  • Memory management implementation
  • sbi 🔒
    SBI call wrappers
  • Synchronization and interior mutability primitives
  • Implementation of syscalls
  • Task management implementation
  • timer 🔒
    RISC-V timer-related functionality
  • Trap handling functionality

Macros

Functions

\ No newline at end of file +

Modules§

  • board 🔒
    Constants used in rCore for qemu
  • config 🔒
    Constants used in rCore
  • console 🔒
    SBI console driver, for text output
  • lang_items 🔒
    The panic handler
  • loader 🔒
    Loading user applications into memory
  • Memory management implementation
  • sbi 🔒
    SBI call wrappers
  • Synchronization and interior mutability primitives
  • Implementation of syscalls
  • Task management implementation
  • timer 🔒
    RISC-V timer-related functionality
  • Trap handling functionality

Macros§

Functions§

\ No newline at end of file diff --git a/ch5/os/lang_items/fn.panic.html b/ch5/os/lang_items/fn.panic.html index c81443c2..3d9564da 100644 --- a/ch5/os/lang_items/fn.panic.html +++ b/ch5/os/lang_items/fn.panic.html @@ -1,2 +1 @@ -panic in os::lang_items - Rust -

Function os::lang_items::panic

source ·
fn panic(info: &PanicInfo<'_>) -> !
\ No newline at end of file +panic in os::lang_items - Rust

Function os::lang_items::panic

source ·
fn panic(info: &PanicInfo<'_>) -> !
\ No newline at end of file diff --git a/ch5/os/lang_items/index.html b/ch5/os/lang_items/index.html index ecde38ea..0cbd95cb 100644 --- a/ch5/os/lang_items/index.html +++ b/ch5/os/lang_items/index.html @@ -1,3 +1,2 @@ -os::lang_items - Rust -

Module os::lang_items

source ·
Expand description

The panic handler

-

Functions

\ No newline at end of file +os::lang_items - Rust

Module os::lang_items

source ·
Expand description

The panic handler

+

Functions§

\ No newline at end of file diff --git a/ch5/os/loader/fn.get_app_data.html b/ch5/os/loader/fn.get_app_data.html index 56346f27..94c43550 100644 --- a/ch5/os/loader/fn.get_app_data.html +++ b/ch5/os/loader/fn.get_app_data.html @@ -1,3 +1,2 @@ -get_app_data in os::loader - Rust -

Function os::loader::get_app_data

source ·
pub fn get_app_data(app_id: usize) -> &'static [u8]
Expand description

get applications data

+get_app_data in os::loader - Rust

Function os::loader::get_app_data

source ·
pub fn get_app_data(app_id: usize) -> &'static [u8]
Expand description

get applications data

\ No newline at end of file diff --git a/ch5/os/loader/fn.get_app_data_by_name.html b/ch5/os/loader/fn.get_app_data_by_name.html index 326a63b9..cadad21b 100644 --- a/ch5/os/loader/fn.get_app_data_by_name.html +++ b/ch5/os/loader/fn.get_app_data_by_name.html @@ -1,3 +1,2 @@ -get_app_data_by_name in os::loader - Rust -
pub fn get_app_data_by_name(name: &str) -> Option<&'static [u8]>
Expand description

get app data from name

+get_app_data_by_name in os::loader - Rust

Function os::loader::get_app_data_by_name

source ·
pub fn get_app_data_by_name(name: &str) -> Option<&'static [u8]>
Expand description

get app data from name

\ No newline at end of file diff --git a/ch5/os/loader/fn.get_num_app.html b/ch5/os/loader/fn.get_num_app.html index e17c7409..b284c28e 100644 --- a/ch5/os/loader/fn.get_num_app.html +++ b/ch5/os/loader/fn.get_num_app.html @@ -1,3 +1,2 @@ -get_num_app in os::loader - Rust -

Function os::loader::get_num_app

source ·
pub fn get_num_app() -> usize
Expand description

get app number

+get_num_app in os::loader - Rust

Function os::loader::get_num_app

source ·
pub fn get_num_app() -> usize
Expand description

get app number

\ No newline at end of file diff --git a/ch5/os/loader/fn.list_apps.html b/ch5/os/loader/fn.list_apps.html index 5c44394f..9bcdcd90 100644 --- a/ch5/os/loader/fn.list_apps.html +++ b/ch5/os/loader/fn.list_apps.html @@ -1,3 +1,2 @@ -list_apps in os::loader - Rust -

Function os::loader::list_apps

source ·
pub fn list_apps()
Expand description

list all apps

+list_apps in os::loader - Rust

Function os::loader::list_apps

source ·
pub fn list_apps()
Expand description

list all apps

\ No newline at end of file diff --git a/ch5/os/loader/index.html b/ch5/os/loader/index.html index 84f2fde6..2e1ee9d6 100644 --- a/ch5/os/loader/index.html +++ b/ch5/os/loader/index.html @@ -1,3 +1,2 @@ -os::loader - Rust -

Module os::loader

source ·
Expand description

Loading user applications into memory

-

Structs

Functions

\ No newline at end of file +os::loader - Rust

Module os::loader

source ·
Expand description

Loading user applications into memory

+

Structs§

Functions§

\ No newline at end of file diff --git a/ch5/os/loader/struct.APP_NAMES.html b/ch5/os/loader/struct.APP_NAMES.html index 6a00e0db..8006c94b 100644 --- a/ch5/os/loader/struct.APP_NAMES.html +++ b/ch5/os/loader/struct.APP_NAMES.html @@ -1,20 +1,19 @@ -APP_NAMES in os::loader - Rust -

Struct os::loader::APP_NAMES

source ·
struct APP_NAMES {
+APP_NAMES in os::loader - Rust

Struct os::loader::APP_NAMES

source ·
struct APP_NAMES {
     __private_field: (),
 }
Expand description

All of app’s name

-

Fields§

§__private_field: ()

Methods from Deref<Target = Vec<&'static str>>§

1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without +

Fields§

§__private_field: ()

Methods from Deref<Target = Vec<&'static str>>§

1.0.0 · source

pub fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without reallocating.

-
Examples
+
§Examples
let mut vec: Vec<i32> = Vec::with_capacity(10);
 vec.push(42);
 assert!(vec.capacity() >= 10);
-
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

+
1.7.0 · source

pub fn as_slice(&self) -> &[T]

Extracts a slice containing the entire vector.

Equivalent to &s[..].

-
Examples
+
§Examples
use std::io::{self, Write};
 let buffer = vec![1, 2, 3, 5, 8];
 io::sink().write(buffer.as_slice()).unwrap();
-
1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer +

1.37.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the vector’s buffer, or a dangling raw pointer valid for zero sized reads if the vector didn’t allocate.

The caller must ensure that the vector outlives the pointer this function returns, or else it will end up pointing to garbage. @@ -30,7 +29,7 @@ Note that calling other methods that materialize mutable references to the slice or mutable references to specific elements you are planning on accessing through this pointer, as well as writing to those elements, may still invalidate this pointer. See the second example below for how this guarantee can be used.

-
Examples
+
§Examples
let x = vec![1, 2, 4];
 let x_ptr = x.as_ptr();
 
@@ -51,172 +50,58 @@ See the second example below for how this guarantee can be used.

// because it mutated a different element: let _ = ptr1.read(); }
-
source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

-
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to +

source

pub fn allocator(&self) -> &A

🔬This is a nightly-only experimental API. (allocator_api)

Returns a reference to the underlying allocator.

+
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the vector, also referred to as its ‘length’.

-
Examples
+
§Examples
let a = vec![1, 2, 3];
 assert_eq!(a.len(), 3);
-
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

-
Examples
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the vector contains no elements.

+
§Examples
let mut v = Vec::new();
 assert!(v.is_empty());
 
 v.push(1);
 assert!(!v.is_empty());
-

Methods from Deref<Target = [T]>§

source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by f64::total_cmp.

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

-
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of -ASCII characters, otherwise returns None.

-
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, -without checking whether they’re valid.

-
Safety
-

Every byte in the slice must be in 0..=127, or else this is UB.

-
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

-

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), -but without allocating and copying temporaries.

-
1.23.0 · source

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

-

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, -but non-ASCII letters are unchanged.

-

To return a new uppercased value without modifying the existing one, use -to_ascii_uppercase.

-
1.23.0 · source

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

-

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, -but non-ASCII letters are unchanged.

-

To return a new lowercased value without modifying the existing one, use -to_ascii_lowercase.

-
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, -treating it as an ASCII string.

-
Examples
-

-let s = b"0\t\r\n'\"\\\x9d";
-let escaped = s.escape_ascii().to_string();
-assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
-
source

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
-assert_eq!(b"  ".trim_ascii_start(), b"");
-assert_eq!(b"".trim_ascii_start(), b"");
-
source

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
-assert_eq!(b"  ".trim_ascii_end(), b"");
-assert_eq!(b"".trim_ascii_end(), b"");
-
source

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes -removed.

-

‘Whitespace’ refers to the definition used by -u8::is_ascii_whitespace.

-
Examples
-
#![feature(byte_slice_trim_ascii)]
-
-assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
-assert_eq!(b"  ".trim_ascii(), b"");
-assert_eq!(b"".trim_ascii(), b"");
-
source

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
-
-assert_eq!(
-    [[1, 2, 3], [4, 5, 6]].flatten(),
-    [[1, 2], [3, 4], [5, 6]].flatten(),
-);
-
-let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
-assert!(slice_of_empty_arrays.flatten().is_empty());
-
-let empty_slice_of_arrays: &[[u32; 10]] = &[];
-assert!(empty_slice_of_arrays.flatten().is_empty());
-
source

pub fn flatten_mut(&mut self) -> &mut [T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &mut [[T; N]], and flattens it to a &mut [T].

-
Panics
-

This panics if the length of the resulting slice would overflow a usize.

-

This is only possible when flattening a slice of arrays of zero-sized -types, and thus tends to be irrelevant in practice. If -size_of::<T>() > 0, this will never panic.

-
Examples
-
#![feature(slice_flatten)]
-
-fn add_5_to_all(slice: &mut [i32]) {
-    for i in slice {
-        *i += 5;
-    }
-}
-
-let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
-add_5_to_all(array.flatten_mut());
-assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
-
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

-

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses -the ordering defined by f32::total_cmp.

-
Current implementation
-

This uses the same sorting algorithm as sort_unstable_by.

-
Examples
-
#![feature(sort_floats)]
-let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
-
-v.sort_floats();
-let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
-assert_eq!(&v[..8], &sorted[..8]);
-assert!(v[8].is_nan());
-
1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

-
Examples
+

Methods from Deref<Target = [T]>§

1.0.0 · source

pub fn len(&self) -> usize

Returns the number of elements in the slice.

+
§Examples
let a = [1, 2, 3];
 assert_eq!(a.len(), 3);
-
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

-
Examples
+
1.0.0 · source

pub fn is_empty(&self) -> bool

Returns true if the slice has a length of 0.

+
§Examples
let a = [1, 2, 3];
-assert!(!a.is_empty());
-
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

-
Examples
+assert!(!a.is_empty()); + +let b: &[i32] = &[]; +assert!(b.is_empty());
+
1.0.0 · source

pub fn first(&self) -> Option<&T>

Returns the first element of the slice, or None if it is empty.

+
§Examples
let v = [10, 40, 30];
 assert_eq!(Some(&10), v.first());
 
 let w: &[i32] = &[];
 assert_eq!(None, w.first());
-
1.0.0 · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

-
Examples
+
1.0.0 · source

pub fn first_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the first element of the slice, or None if it is empty.

+
§Examples
let x = &mut [0, 1, 2];
 
 if let Some(first) = x.first_mut() {
     *first = 5;
 }
-assert_eq!(x, &[5, 1, 2]);
-
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
+assert_eq!(x, &[5, 1, 2]); + +let y: &mut [i32] = &mut []; +assert_eq!(None, y.first_mut());
+
1.5.0 · source

pub fn split_first(&self) -> Option<(&T, &[T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
let x = &[0, 1, 2];
 
 if let Some((first, elements)) = x.split_first() {
     assert_eq!(first, &0);
     assert_eq!(elements, &[1, 2]);
 }
-
1.5.0 · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

-
Examples
+
1.5.0 · source

pub fn split_first_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the first and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
let x = &mut [0, 1, 2];
 
 if let Some((first, elements)) = x.split_first_mut() {
@@ -225,16 +110,16 @@ v.sort_floats();
     elements[1] = 5;
 }
 assert_eq!(x, &[3, 4, 5]);
-
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
+
1.5.0 · source

pub fn split_last(&self) -> Option<(&T, &[T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
let x = &[0, 1, 2];
 
 if let Some((last, elements)) = x.split_last() {
     assert_eq!(last, &2);
     assert_eq!(elements, &[0, 1]);
 }
-
1.5.0 · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
+
1.5.0 · source

pub fn split_last_mut(&mut self) -> Option<(&mut T, &mut [T])>

Returns the last and all the rest of the elements of the slice, or None if it is empty.

+
§Examples
let x = &mut [0, 1, 2];
 
 if let Some((last, elements)) = x.split_last_mut() {
@@ -243,26 +128,28 @@ v.sort_floats();
     elements[1] = 5;
 }
 assert_eq!(x, &[4, 5, 3]);
-
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

-
Examples
+
1.0.0 · source

pub fn last(&self) -> Option<&T>

Returns the last element of the slice, or None if it is empty.

+
§Examples
let v = [10, 40, 30];
 assert_eq!(Some(&30), v.last());
 
 let w: &[i32] = &[];
 assert_eq!(None, w.last());
-
1.0.0 · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable pointer to the last item in the slice.

-
Examples
+
1.0.0 · source

pub fn last_mut(&mut self) -> Option<&mut T>

Returns a mutable reference to the last item in the slice, or None if it is empty.

+
§Examples
let x = &mut [0, 1, 2];
 
 if let Some(last) = x.last_mut() {
     *last = 10;
 }
-assert_eq!(x, &[0, 1, 10]);
-
source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice, or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
+assert_eq!(x, &[0, 1, 10]);
 
-let u = [10, 40, 30];
+let y: &mut [i32] = &mut [];
+assert_eq!(None, y.last_mut());
+
1.77.0 · source

pub fn first_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
 assert_eq!(Some(&[10, 40]), u.first_chunk::<2>());
 
 let v: &[i32] = &[10];
@@ -270,74 +157,76 @@ v.sort_floats();
 
 let w: &[i32] = &[];
 assert_eq!(Some(&[]), w.first_chunk::<0>());
-
source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
+
1.77.0 · source

pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the first N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
 
 if let Some(first) = x.first_chunk_mut::<2>() {
     first[0] = 5;
     first[1] = 4;
 }
-assert_eq!(x, &[5, 4, 2]);
-
source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
+assert_eq!(x, &[5, 4, 2]);
 
-let x = &[0, 1, 2];
+assert_eq!(None, x.first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_first_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

Return an array reference to the first N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
 
 if let Some((first, elements)) = x.split_first_chunk::<2>() {
     assert_eq!(first, &[0, 1]);
     assert_eq!(elements, &[2]);
-}
-
source

pub fn split_first_chunk_mut<const N: usize>( - &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable reference to the first N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
+}
 
-let x = &mut [0, 1, 2];
+assert_eq!(None, x.split_first_chunk::<4>());
+
1.77.0 · source

pub fn split_first_chunk_mut<const N: usize>( + &mut self +) -> Option<(&mut [T; N], &mut [T])>

Return a mutable array reference to the first N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
 
 if let Some((first, elements)) = x.split_first_chunk_mut::<2>() {
     first[0] = 3;
     first[1] = 4;
     elements[0] = 5;
 }
-assert_eq!(x, &[3, 4, 5]);
-
source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T; N], &[T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last N elements of the slice and the remainder, -or None if it has fewer than N elements.

-
Examples
-
#![feature(slice_first_last_chunk)]
+assert_eq!(x, &[3, 4, 5]);
 
-let x = &[0, 1, 2];
+assert_eq!(None, x.split_first_chunk_mut::<4>());
+
1.77.0 · source

pub fn split_last_chunk<const N: usize>(&self) -> Option<(&[T], &[T; N])>

Return an array reference to the last N items in the slice and the remaining slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &[0, 1, 2];
 
-if let Some((last, elements)) = x.split_last_chunk::<2>() {
-    assert_eq!(last, &[1, 2]);
+if let Some((elements, last)) = x.split_last_chunk::<2>() {
     assert_eq!(elements, &[0]);
-}
-
source

pub fn split_last_chunk_mut<const N: usize>( + assert_eq!(last, &[1, 2]); +} + +assert_eq!(None, x.split_last_chunk::<4>());

+
1.77.0 · source

pub fn split_last_chunk_mut<const N: usize>( &mut self -) -> Option<(&mut [T; N], &mut [T])>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last and all the rest of the elements of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
+) -> Option<(&mut [T], &mut [T; N])>

Return a mutable array reference to the last N items in the slice and the remaining +slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
 
-let x = &mut [0, 1, 2];
-
-if let Some((last, elements)) = x.split_last_chunk_mut::<2>() {
+if let Some((elements, last)) = x.split_last_chunk_mut::<2>() {
     last[0] = 3;
     last[1] = 4;
     elements[0] = 5;
 }
-assert_eq!(x, &[5, 3, 4]);
-
source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns the last element of the slice, or None if it is empty.

-
Examples
-
#![feature(slice_first_last_chunk)]
+assert_eq!(x, &[5, 3, 4]);
 
-let u = [10, 40, 30];
+assert_eq!(None, x.split_last_chunk_mut::<4>());
+
1.77.0 · source

pub fn last_chunk<const N: usize>(&self) -> Option<&[T; N]>

Return an array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let u = [10, 40, 30];
 assert_eq!(Some(&[40, 30]), u.last_chunk::<2>());
 
 let v: &[i32] = &[10];
@@ -345,18 +234,19 @@ or None if it has fewer than N elements.

let w: &[i32] = &[]; assert_eq!(Some(&[]), w.last_chunk::<0>());
-
source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

🔬This is a nightly-only experimental API. (slice_first_last_chunk)

Returns a mutable pointer to the last item in the slice.

-
Examples
-
#![feature(slice_first_last_chunk)]
-
-let x = &mut [0, 1, 2];
+
1.77.0 · source

pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [T; N]>

Return a mutable array reference to the last N items in the slice.

+

If the slice is not at least N in length, this will return None.

+
§Examples
+
let x = &mut [0, 1, 2];
 
 if let Some(last) = x.last_chunk_mut::<2>() {
     last[0] = 10;
     last[1] = 20;
 }
-assert_eq!(x, &[0, 10, 20]);
-
1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where +assert_eq!(x, &[0, 10, 20]); + +assert_eq!(None, x.last_chunk_mut::<4>());
+

1.0.0 · source

pub fn get<I>(&self, index: I) -> Option<&<I as SliceIndex<[T]>>::Output>
where I: SliceIndex<[T]>,

Returns a reference to an element or subslice depending on the type of index.

    @@ -365,60 +255,60 @@ position or None if out of bounds.
  • If given a range, returns the subslice corresponding to that range, or None if out of bounds.
-
Examples
+
§Examples
let v = [10, 40, 30];
 assert_eq!(Some(&40), v.get(1));
 assert_eq!(Some(&[10, 40][..]), v.get(0..2));
 assert_eq!(None, v.get(3));
 assert_eq!(None, v.get(0..4));
-
1.0.0 · source

pub fn get_mut<I>( +

1.0.0 · source

pub fn get_mut<I>( &mut self, index: I ) -> Option<&mut <I as SliceIndex<[T]>>::Output>
where I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice depending on the type of index (see get) or None if the index is out of bounds.

-
Examples
+
§Examples
let x = &mut [0, 1, 2];
 
 if let Some(elem) = x.get_mut(1) {
     *elem = 42;
 }
 assert_eq!(x, &[0, 42, 2]);
-
1.0.0 · source

pub unsafe fn get_unchecked<I>( +

1.0.0 · source

pub unsafe fn get_unchecked<I>( &self, index: I ) -> &<I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

Returns a reference to an element or subslice, without doing bounds checking.

For a safe alternative see get.

-
Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

You can think of this like .get(index).unwrap_unchecked(). It’s UB to call .get_unchecked(len), even if you immediately convert to a pointer. And it’s UB to call .get_unchecked(..len + 1), .get_unchecked(..=len), or similar.

-
Examples
+
§Examples
let x = &[1, 2, 4];
 
 unsafe {
     assert_eq!(x.get_unchecked(1), &2);
 }
-
1.0.0 · source

pub unsafe fn get_unchecked_mut<I>( +

1.0.0 · source

pub unsafe fn get_unchecked_mut<I>( &mut self, index: I ) -> &mut <I as SliceIndex<[T]>>::Output
where I: SliceIndex<[T]>,

Returns a mutable reference to an element or subslice, without doing bounds checking.

For a safe alternative see get_mut.

-
Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used.

You can think of this like .get_mut(index).unwrap_unchecked(). It’s UB to call .get_unchecked_mut(len), even if you immediately convert to a pointer. And it’s UB to call .get_unchecked_mut(..len + 1), .get_unchecked_mut(..=len), or similar.

-
Examples
+
§Examples
let x = &mut [1, 2, 4];
 
 unsafe {
@@ -426,7 +316,7 @@ to a pointer.  And it’s UB to call .get_unchecked_mut(..len + 1),
     *elem = 13;
 }
 assert_eq!(x, &[1, 13, 4]);
-
1.0.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

+
1.0.0 · source

pub fn as_ptr(&self) -> *const T

Returns a raw pointer to the slice’s buffer.

The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage.

The caller must also ensure that the memory the pointer (non-transitively) points to @@ -434,7 +324,7 @@ is never written to (except inside an UnsafeCell) using this pointe derived from it. If you need to mutate the contents of the slice, use as_mut_ptr.

Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid.

-
Examples
+
§Examples
let x = &[1, 2, 4];
 let x_ptr = x.as_ptr();
 
@@ -443,12 +333,12 @@ to be reallocated, which would also make any pointers to it invalid.

assert_eq!(x.get_unchecked(i), &*x_ptr.add(i)); } }
-
1.0.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

+
1.0.0 · source

pub fn as_mut_ptr(&mut self) -> *mut T

Returns an unsafe mutable pointer to the slice’s buffer.

The caller must ensure that the slice outlives the pointer this function returns, or else it will end up pointing to garbage.

Modifying the container referenced by this slice may cause its buffer to be reallocated, which would also make any pointers to it invalid.

-
Examples
+
§Examples
let x = &mut [1, 2, 4];
 let x_ptr = x.as_mut_ptr();
 
@@ -458,7 +348,7 @@ to be reallocated, which would also make any pointers to it invalid.

} } assert_eq!(x, &[3, 4, 6]);
-
1.48.0 · source

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

+
1.48.0 · source

pub fn as_ptr_range(&self) -> Range<*const T>

Returns the two raw pointers spanning the slice.

The returned range is half-open, which means that the end pointer points one past the last element of the slice. This way, an empty slice is represented by two equal pointers, and the difference between @@ -478,7 +368,7 @@ element of this slice:

assert!(a.as_ptr_range().contains(&x)); assert!(!a.as_ptr_range().contains(&y));
-
1.48.0 · source

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

+
1.48.0 · source

pub fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Returns the two unsafe mutable pointers spanning the slice.

The returned range is half-open, which means that the end pointer points one past the last element of the slice. This way, an empty slice is represented by two equal pointers, and the difference between @@ -489,44 +379,44 @@ in the slice.

This function is useful for interacting with foreign interfaces which use two pointers to refer to a range of elements in memory, as is common in C++.

-
1.0.0 · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

+
1.0.0 · source

pub fn swap(&mut self, a: usize, b: usize)

Swaps two elements in the slice.

If a equals to b, it’s guaranteed that elements won’t change value.

-
Arguments
+
§Arguments
  • a - The index of the first element
  • b - The index of the second element
-
Panics
+
§Panics

Panics if a or b are out of bounds.

-
Examples
+
§Examples
let mut v = ["a", "b", "c", "d", "e"];
 v.swap(2, 4);
 assert!(v == ["a", "b", "e", "d", "c"]);
-
source

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

+
source

pub unsafe fn swap_unchecked(&mut self, a: usize, b: usize)

🔬This is a nightly-only experimental API. (slice_swap_unchecked)

Swaps two elements in the slice, without doing bounds checking.

For a safe alternative see swap.

-
Arguments
+
§Arguments
  • a - The index of the first element
  • b - The index of the second element
-
Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior. The caller has to ensure that a < self.len() and b < self.len().

-
Examples
+
§Examples
#![feature(slice_swap_unchecked)]
 
 let mut v = ["a", "b", "c", "d"];
 // SAFETY: we know that 1 and 3 are both indices of the slice
 unsafe { v.swap_unchecked(1, 3) };
 assert!(v == ["a", "d", "c", "b"]);
-
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

-
Examples
+
1.0.0 · source

pub fn reverse(&mut self)

Reverses the order of elements in the slice, in place.

+
§Examples
let mut v = [1, 2, 3];
 v.reverse();
 assert!(v == [3, 2, 1]);
-
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

+
1.0.0 · source

pub fn iter(&self) -> Iter<'_, T>

Returns an iterator over the slice.

The iterator yields all items from start to end.

-
Examples
+
§Examples
let x = &[1, 2, 4];
 let mut iterator = x.iter();
 
@@ -534,20 +424,20 @@ v.reverse();
 assert_eq!(iterator.next(), Some(&2));
 assert_eq!(iterator.next(), Some(&4));
 assert_eq!(iterator.next(), None);
-
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

+
1.0.0 · source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Returns an iterator that allows modifying each value.

The iterator yields all items from start to end.

-
Examples
+
§Examples
let x = &mut [1, 2, 4];
 for elem in x.iter_mut() {
     *elem += 2;
 }
 assert_eq!(x, &[3, 4, 6]);
-
1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length +

1.0.0 · source

pub fn windows(&self, size: usize) -> Windows<'_, T>

Returns an iterator over all contiguous windows of length size. The windows overlap. If the slice is shorter than size, the iterator returns no values.

-
Panics
+
§Panics

Panics if size is 0.

-
Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.windows(3);
 assert_eq!(iter.next().unwrap(), &['l', 'o', 'r']);
@@ -573,32 +463,32 @@ conjunction with windows to accomplish something similar:

Cell::swap(&w[0], &w[2]); } assert_eq!(array, ['s', 't', ' ', '2', '0', '1', '5', 'u', 'R']);
-
1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · source

pub fn chunks(&self, chunk_size: usize) -> Chunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

See chunks_exact for a variant of this iterator that returns chunks of always exactly chunk_size elements, and rchunks for the same iterator but starting at the end of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.chunks(2);
 assert_eq!(iter.next().unwrap(), &['l', 'o']);
 assert_eq!(iter.next().unwrap(), &['r', 'e']);
 assert_eq!(iter.next().unwrap(), &['m']);
 assert!(iter.next().is_none());
-
1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.0.0 · source

pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

See chunks_exact_mut for a variant of this iterator that returns chunks of always exactly chunk_size elements, and rchunks_mut for the same iterator but starting at the end of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
 
@@ -609,7 +499,7 @@ the end of the slice.

count += 1; } assert_eq!(v, &[1, 1, 2, 2, 3]);
-
1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · source

pub fn chunks_exact(&self, chunk_size: usize) -> ChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -618,16 +508,16 @@ from the remainder function of the iterator.

resulting code better than in the case of chunks.

See chunks for a variant of this iterator that also returns the remainder as a smaller chunk, and rchunks_exact for the same iterator but starting at the end of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.chunks_exact(2);
 assert_eq!(iter.next().unwrap(), &['l', 'o']);
 assert_eq!(iter.next().unwrap(), &['r', 'e']);
 assert!(iter.next().is_none());
 assert_eq!(iter.remainder(), &['m']);
-
1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · source

pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -637,9 +527,9 @@ resulting code better than in the case of chunks_mut for a variant of this iterator that also returns the remainder as a smaller chunk, and rchunks_exact_mut for the same iterator but starting at the end of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
 
@@ -650,15 +540,15 @@ the slice.

count += 1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

source

pub unsafe fn as_chunks_unchecked<const N: usize>(&self) -> &[[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

-
Safety
+
§Safety

This may only be called when

  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • N != 0.
-
Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice: &[char] = &['l', 'o', 'r', 'e', 'm', '!'];
 let chunks: &[[char; 1]] =
@@ -673,13 +563,13 @@ assuming that there’s no remainder.

// These would be unsound: // let chunks: &[[_; 5]] = slice.as_chunks_unchecked() // The slice length is not a multiple of 5 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked() // Zero-length chunks are never allowed
-
source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

source

pub fn as_chunks<const N: usize>(&self) -> (&[[T; N]], &[T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice = ['l', 'o', 'r', 'e', 'm'];
 let (chunks, remainder) = slice.as_chunks();
@@ -694,28 +584,28 @@ error before this method gets stabilized.

panic!("slice didn't have even length") }; assert_eq!(chunks, &[['R', 'u'], ['s', 't']]);
-
source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

source

pub fn as_rchunks<const N: usize>(&self) -> (&[T], &[[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice = ['l', 'o', 'r', 'e', 'm'];
 let (remainder, chunks) = slice.as_rchunks();
 assert_eq!(remainder, &['l']);
 assert_eq!(chunks, &[['o', 'r'], ['e', 'm']]);
-
source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

source

pub fn array_chunks<const N: usize>(&self) -> ArrayChunks<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be retrieved from the remainder function of the iterator.

This method is the const generic equivalent of chunks_exact.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(array_chunks)]
 let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.array_chunks();
@@ -723,17 +613,17 @@ error before this method gets stabilized.

assert_eq!(iter.next().unwrap(), &['r', 'e']); assert!(iter.next().is_none()); assert_eq!(iter.remainder(), &['m']);
-
source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( +

source

pub unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self ) -> &mut [[T; N]]

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, assuming that there’s no remainder.

-
Safety
+
§Safety

This may only be called when

  • The slice splits exactly into N-element chunks (aka self.len() % N == 0).
  • N != 0.
-
Examples
+
§Examples
#![feature(slice_as_chunks)]
 let slice: &mut [char] = &mut ['l', 'o', 'r', 'e', 'm', '!'];
 let chunks: &mut [[char; 1]] =
@@ -750,13 +640,13 @@ chunks[1] = ['a', // These would be unsound:
 // let chunks: &[[_; 5]] = slice.as_chunks_unchecked_mut() // The slice length is not a multiple of 5
 // let chunks: &[[_; 0]] = slice.as_chunks_unchecked_mut() // Zero-length chunks are never allowed
-
source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

source

pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[T; N]], &mut [T])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the beginning of the slice, and a remainder slice with length strictly less than N.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(slice_as_chunks)]
 let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
@@ -768,13 +658,13 @@ remainder[0] = 9;
     count += 1;
 }
 assert_eq!(v, &[1, 1, 2, 2, 9]);
-
source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, +

source

pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [T], &mut [[T; N]])

🔬This is a nightly-only experimental API. (slice_as_chunks)

Splits the slice into a slice of N-element arrays, starting at the end of the slice, and a remainder slice with length strictly less than N.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(slice_as_chunks)]
 let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
@@ -786,16 +676,16 @@ remainder[0] = 9;
     count += 1;
 }
 assert_eq!(v, &[9, 1, 1, 2, 2]);
-
source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the +

source

pub fn array_chunks_mut<const N: usize>(&mut self) -> ArrayChunksMut<'_, T, N>

🔬This is a nightly-only experimental API. (array_chunks)

Returns an iterator over N elements of the slice at a time, starting at the beginning of the slice.

The chunks are mutable array references and do not overlap. If N does not divide the length of the slice, then the last up to N-1 elements will be omitted and can be retrieved from the into_remainder function of the iterator.

This method is the const generic equivalent of chunks_exact_mut.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(array_chunks)]
 let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
@@ -805,14 +695,14 @@ error before this method gets stabilized.

count += 1; } assert_eq!(v, &[1, 1, 2, 2, 0]);
-
source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, +

source

pub fn array_windows<const N: usize>(&self) -> ArrayWindows<'_, T, N>

🔬This is a nightly-only experimental API. (array_windows)

Returns an iterator over overlapping windows of N elements of a slice, starting at the beginning of the slice.

This is the const generic equivalent of windows.

If N is greater than the size of the slice, it will return no windows.

-
Panics
+
§Panics

Panics if N is 0. This check will most probably get changed to a compile time error before this method gets stabilized.

-
Examples
+
§Examples
#![feature(array_windows)]
 let slice = [0, 1, 2, 3];
 let mut iter = slice.array_windows();
@@ -820,32 +710,32 @@ error before this method gets stabilized.

assert_eq!(iter.next().unwrap(), &[1, 2]); assert_eq!(iter.next().unwrap(), &[2, 3]); assert!(iter.next().is_none());
-
1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · source

pub fn rchunks(&self, chunk_size: usize) -> RChunks<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

See rchunks_exact for a variant of this iterator that returns chunks of always exactly chunk_size elements, and chunks for the same iterator but starting at the beginning of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.rchunks(2);
 assert_eq!(iter.next().unwrap(), &['e', 'm']);
 assert_eq!(iter.next().unwrap(), &['o', 'r']);
 assert_eq!(iter.next().unwrap(), &['l']);
 assert!(iter.next().is_none());
-
1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · source

pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last chunk will not have length chunk_size.

See rchunks_exact_mut for a variant of this iterator that returns chunks of always exactly chunk_size elements, and chunks_mut for the same iterator but starting at the beginning of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
 
@@ -856,7 +746,7 @@ beginning of the slice.

count += 1; } assert_eq!(v, &[3, 2, 2, 1, 1]);
-
1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the +

1.31.0 · source

pub fn rchunks_exact(&self, chunk_size: usize) -> RChunksExact<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are slices and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be retrieved @@ -866,16 +756,16 @@ resulting code better than in the case of rchunks for a variant of this iterator that also returns the remainder as a smaller chunk, and chunks_exact for the same iterator but starting at the beginning of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let slice = ['l', 'o', 'r', 'e', 'm'];
 let mut iter = slice.rchunks_exact(2);
 assert_eq!(iter.next().unwrap(), &['e', 'm']);
 assert_eq!(iter.next().unwrap(), &['o', 'r']);
 assert!(iter.next().is_none());
 assert_eq!(iter.remainder(), &['l']);
-
1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end +

1.31.0 · source

pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, T>

Returns an iterator over chunk_size elements of the slice at a time, starting at the end of the slice.

The chunks are mutable slices, and do not overlap. If chunk_size does not divide the length of the slice, then the last up to chunk_size-1 elements will be omitted and can be @@ -885,9 +775,9 @@ resulting code better than in the case of rchunks_mut for a variant of this iterator that also returns the remainder as a smaller chunk, and chunks_exact_mut for the same iterator but starting at the beginning of the slice.

-
Panics
+
§Panics

Panics if chunk_size is 0.

-
Examples
+
§Examples
let v = &mut [0, 0, 0, 0, 0];
 let mut count = 1;
 
@@ -898,18 +788,16 @@ of the slice.

count += 1; } assert_eq!(v, &[0, 2, 2, 1, 1]);
-
source

pub fn group_by<F>(&self, pred: F) -> GroupBy<'_, T, F>
where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping runs +

1.77.0 · source

pub fn chunk_by<F>(&self, pred: F) -> ChunkBy<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping runs of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
 
-let slice = &[1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by(|a, b| a == b);
+let mut iter = slice.chunk_by(|a, b| a == b);
 
 assert_eq!(iter.next(), Some(&[1, 1, 1][..]));
 assert_eq!(iter.next(), Some(&[3, 3][..]));
@@ -917,28 +805,24 @@ then on slice[1] and slice[2] and so on.

assert_eq!(iter.next(), None);

This method can be used to extract the sorted subslices:

-
#![feature(slice_group_by)]
+
let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
 
-let slice = &[1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by(|a, b| a <= b);
+let mut iter = slice.chunk_by(|a, b| a <= b);
 
 assert_eq!(iter.next(), Some(&[1, 1, 2, 3][..]));
 assert_eq!(iter.next(), Some(&[2, 3][..]));
 assert_eq!(iter.next(), Some(&[2, 3, 4][..]));
 assert_eq!(iter.next(), None);
-
source

pub fn group_by_mut<F>(&mut self, pred: F) -> GroupByMut<'_, T, F>
where - F: FnMut(&T, &T) -> bool,

🔬This is a nightly-only experimental API. (slice_group_by)

Returns an iterator over the slice producing non-overlapping mutable +

1.77.0 · source

pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, T, F>
where + F: FnMut(&T, &T) -> bool,

Returns an iterator over the slice producing non-overlapping mutable runs of elements using the predicate to separate them.

-

The predicate is called on two elements following themselves, -it means the predicate is called on slice[0] and slice[1] -then on slice[1] and slice[2] and so on.

-
Examples
-
#![feature(slice_group_by)]
+

The predicate is called for every pair of consecutive elements, +meaning that it is called on slice[0] and slice[1], +followed by slice[1] and slice[2], and so on.

+
§Examples
+
let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
 
-let slice = &mut [1, 1, 1, 3, 3, 2, 2, 2];
-
-let mut iter = slice.group_by_mut(|a, b| a == b);
+let mut iter = slice.chunk_by_mut(|a, b| a == b);
 
 assert_eq!(iter.next(), Some(&mut [1, 1, 1][..]));
 assert_eq!(iter.next(), Some(&mut [3, 3][..]));
@@ -946,23 +830,22 @@ then on slice[1] and slice[2] and so on.

assert_eq!(iter.next(), None);

This method can be used to extract the sorted subslices:

-
#![feature(slice_group_by)]
+
let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
 
-let slice = &mut [1, 1, 2, 3, 2, 3, 2, 3, 4];
-
-let mut iter = slice.group_by_mut(|a, b| a <= b);
+let mut iter = slice.chunk_by_mut(|a, b| a <= b);
 
 assert_eq!(iter.next(), Some(&mut [1, 1, 2, 3][..]));
 assert_eq!(iter.next(), Some(&mut [2, 3][..]));
 assert_eq!(iter.next(), Some(&mut [2, 3, 4][..]));
 assert_eq!(iter.next(), None);
-
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

+
1.0.0 · source

pub fn split_at(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_checked.

+
§Examples
let v = [1, 2, 3, 4, 5, 6];
 
 {
@@ -982,13 +865,14 @@ indices from [mid, len) (excluding the index len itsel
     assert_eq!(left, [1, 2, 3, 4, 5, 6]);
     assert_eq!(right, []);
 }
-
1.0.0 · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

+
1.0.0 · source

pub fn split_at_mut(&mut self, mid: usize) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

-
Panics
-

Panics if mid > len.

-
Examples
+
§Panics
+

Panics if mid > len. For a non-panicking alternative see +split_at_mut_checked.

+
§Examples
let mut v = [1, 0, 3, 0, 5, 6];
 let (left, right) = v.split_at_mut(2);
 assert_eq!(left, [1, 0]);
@@ -996,19 +880,17 @@ indices from [mid, len) (excluding the index len itsel
 left[1] = 2;
 right[1] = 4;
 assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one slice into two at an index, without doing bounds checking.

+
1.80.0 · source

pub unsafe fn split_at_unchecked(&self, mid: usize) -> (&[T], &[T])

Divides one slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

For a safe alternative see split_at.

-
Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used. The caller has to ensure that 0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let v = [1, 2, 3, 4, 5, 6];
+
§Examples
+
let v = [1, 2, 3, 4, 5, 6];
 
 unsafe {
    let (left, right) = v.split_at_unchecked(0);
@@ -1027,22 +909,20 @@ even if the resulting reference is not used. The caller has to ensure that
     assert_eq!(left, [1, 2, 3, 4, 5, 6]);
     assert_eq!(right, []);
 }
-
source

pub unsafe fn split_at_mut_unchecked( +

1.80.0 · source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: usize -) -> (&mut [T], &mut [T])

🔬This is a nightly-only experimental API. (slice_split_at_unchecked)

Divides one mutable slice into two at an index, without doing bounds checking.

+) -> (&mut [T], &mut [T])

Divides one mutable slice into two at an index, without doing bounds checking.

The first will contain all indices from [0, mid) (excluding the index mid itself) and the second will contain all indices from [mid, len) (excluding the index len itself).

For a safe alternative see split_at_mut.

-
Safety
+
§Safety

Calling this method with an out-of-bounds index is undefined behavior even if the resulting reference is not used. The caller has to ensure that 0 <= mid <= self.len().

-
Examples
-
#![feature(slice_split_at_unchecked)]
-
-let mut v = [1, 0, 3, 0, 5, 6];
+
§Examples
+
let mut v = [1, 0, 3, 0, 5, 6];
 // scoped to restrict the lifetime of the borrows
 unsafe {
     let (left, right) = v.split_at_mut_unchecked(2);
@@ -1052,100 +932,65 @@ even if the resulting reference is not used. The caller has to ensure that
     right[1] = 4;
 }
 assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
source

pub fn split_array_ref<const N: usize>(&self) -> (&[T; N], &[T])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
+
source

pub fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])>

🔬This is a nightly-only experimental API. (split_at_checked)

Divides one slice into two at an index, returning None if the slice is +too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
#![feature(split_at_checked)]
 
-let v = &[1, 2, 3, 4, 5, 6][..];
+let v = [1, -2, 3, -4, 5, -6];
 
 {
-   let (left, right) = v.split_array_ref::<0>();
-   assert_eq!(left, &[]);
-   assert_eq!(right, [1, 2, 3, 4, 5, 6]);
+   let (left, right) = v.split_at_checked(0).unwrap();
+   assert_eq!(left, []);
+   assert_eq!(right, [1, -2, 3, -4, 5, -6]);
 }
 
 {
-    let (left, right) = v.split_array_ref::<2>();
-    assert_eq!(left, &[1, 2]);
-    assert_eq!(right, [3, 4, 5, 6]);
+    let (left, right) = v.split_at_checked(2).unwrap();
+    assert_eq!(left, [1, -2]);
+    assert_eq!(right, [3, -4, 5, -6]);
 }
 
 {
-    let (left, right) = v.split_array_ref::<6>();
-    assert_eq!(left, &[1, 2, 3, 4, 5, 6]);
+    let (left, right) = v.split_at_checked(6).unwrap();
+    assert_eq!(left, [1, -2, 3, -4, 5, -6]);
     assert_eq!(right, []);
-}
-
source

pub fn split_array_mut<const N: usize>(&mut self) -> (&mut [T; N], &mut [T])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an index.

-

The array will contain all indices from [0, N) (excluding -the index N itself) and the slice will contain all -indices from [N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.split_array_mut::<2>();
-assert_eq!(left, &mut [1, 0]);
-assert_eq!(right, [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
source

pub fn rsplit_array_ref<const N: usize>(&self) -> (&[T], &[T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one slice into an array and a remainder slice at an index from -the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index len - N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let v = &[1, 2, 3, 4, 5, 6][..];
-
-{
-   let (left, right) = v.rsplit_array_ref::<0>();
-   assert_eq!(left, [1, 2, 3, 4, 5, 6]);
-   assert_eq!(right, &[]);
 }
 
-{
-    let (left, right) = v.rsplit_array_ref::<2>();
-    assert_eq!(left, [1, 2, 3, 4]);
-    assert_eq!(right, &[5, 6]);
+assert_eq!(None, v.split_at_checked(7));
+
source

pub fn split_at_mut_checked( + &mut self, + mid: usize +) -> Option<(&mut [T], &mut [T])>

🔬This is a nightly-only experimental API. (split_at_checked)

Divides one mutable slice into two at an index, returning None if the +slice is too short.

+

If mid ≤ len returns a pair of slices where the first will contain all +indices from [0, mid) (excluding the index mid itself) and the +second will contain all indices from [mid, len) (excluding the index +len itself).

+

Otherwise, if mid > len, returns None.

+
§Examples
+
#![feature(split_at_checked)]
+
+let mut v = [1, 0, 3, 0, 5, 6];
+
+if let Some((left, right)) = v.split_at_mut_checked(2) {
+    assert_eq!(left, [1, 0]);
+    assert_eq!(right, [3, 0, 5, 6]);
+    left[1] = 2;
+    right[1] = 4;
 }
+assert_eq!(v, [1, 2, 3, 4, 5, 6]);
 
-{
-    let (left, right) = v.rsplit_array_ref::<6>();
-    assert_eq!(left, []);
-    assert_eq!(right, &[1, 2, 3, 4, 5, 6]);
-}
-
source

pub fn rsplit_array_mut<const N: usize>(&mut self) -> (&mut [T], &mut [T; N])

🔬This is a nightly-only experimental API. (split_array)

Divides one mutable slice into an array and a remainder slice at an -index from the end.

-

The slice will contain all indices from [0, len - N) (excluding -the index N itself) and the array will contain all -indices from [len - N, len) (excluding the index len itself).

-
Panics
-

Panics if N > len.

-
Examples
-
#![feature(split_array)]
-
-let mut v = &mut [1, 0, 3, 0, 5, 6][..];
-let (left, right) = v.rsplit_array_mut::<4>();
-assert_eq!(left, [1, 0]);
-assert_eq!(right, &mut [3, 0, 5, 6]);
-left[1] = 2;
-right[1] = 4;
-assert_eq!(v, [1, 2, 3, 4, 5, 6]);
-
1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where +assert_eq!(None, v.split_at_mut_checked(7));
+

1.0.0 · source

pub fn split<F>(&self, pred: F) -> Split<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

-
Examples
+
§Examples
let slice = [10, 40, 33, 20];
 let mut iter = slice.split(|num| num % 3 == 0);
 
@@ -1173,21 +1018,21 @@ present between them:

assert_eq!(iter.next().unwrap(), &[]); assert_eq!(iter.next().unwrap(), &[20]); assert!(iter.next().is_none());
-
1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where +

1.0.0 · source

pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is not contained in the subslices.

-
Examples
+
§Examples
let mut v = [10, 40, 30, 20, 60, 50];
 
 for group in v.split_mut(|num| *num % 3 == 0) {
     group[0] = 1;
 }
 assert_eq!(v, [1, 40, 30, 1, 60, 1]);
-
1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where +

1.51.0 · source

pub fn split_inclusive<F>(&self, pred: F) -> SplitInclusive<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred. The matched element is contained in the end of the previous subslice as a terminator.

-
Examples
+
§Examples
let slice = [10, 40, 33, 20];
 let mut iter = slice.split_inclusive(|num| num % 3 == 0);
 
@@ -1204,11 +1049,11 @@ That slice will be the last item returned by the iterator.

assert_eq!(iter.next().unwrap(), &[3]); assert_eq!(iter.next().unwrap(), &[10, 40, 33]); assert!(iter.next().is_none());
-
1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where +

1.51.0 · source

pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred. The matched element is contained in the previous subslice as a terminator.

-
Examples
+
§Examples
let mut v = [10, 40, 30, 20, 60, 50];
 
 for group in v.split_inclusive_mut(|num| *num % 3 == 0) {
@@ -1216,11 +1061,11 @@ subslice as a terminator.

group[terminator_idx] = 1; } assert_eq!(v, [10, 40, 1, 20, 1, 1]);
-
1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where +

1.27.0 · source

pub fn rsplit<F>(&self, pred: F) -> RSplit<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

-
Examples
+
§Examples
let slice = [11, 22, 33, 0, 44, 55];
 let mut iter = slice.rsplit(|num| *num == 0);
 
@@ -1237,11 +1082,11 @@ slice will be the first (or last) item returned by the iterator.

assert_eq!(it.next().unwrap(), &[1, 1]); assert_eq!(it.next().unwrap(), &[]); assert_eq!(it.next(), None);
-
1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where +

1.27.0 · source

pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, starting at the end of the slice and working backwards. The matched element is not contained in the subslices.

-
Examples
+
§Examples
let mut v = [100, 400, 300, 200, 600, 500];
 
 let mut count = 0;
@@ -1250,13 +1095,13 @@ backwards. The matched element is not contained in the subslices.

group[0] = count; } assert_eq!(v, [3, 400, 300, 2, 600, 1]);
-
1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where +

1.0.0 · source

pub fn splitn<F>(&self, n: usize, pred: F) -> SplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

The last element returned, if any, will contain the remainder of the slice.

-
Examples
+
§Examples

Print the slice split once by numbers divisible by 3 (i.e., [10, 40], [20, 60, 50]):

@@ -1265,27 +1110,27 @@ slice.

for group in v.splitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where +

1.0.0 · source

pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over mutable subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices.

The last element returned, if any, will contain the remainder of the slice.

-
Examples
+
§Examples
let mut v = [10, 40, 30, 20, 60, 50];
 
 for group in v.splitn_mut(2, |num| *num % 3 == 0) {
     group[0] = 1;
 }
 assert_eq!(v, [1, 40, 30, 1, 60, 50]);
-
1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where +

1.0.0 · source

pub fn rsplitn<F>(&self, n: usize, pred: F) -> RSplitN<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices.

The last element returned, if any, will contain the remainder of the slice.

-
Examples
+
§Examples

Print the slice split once, starting from the end, by numbers divisible by 3 (i.e., [50], [10, 40, 30, 20]):

@@ -1294,27 +1139,27 @@ by 3 (i.e., [50], [10, 40, 30, 20]):

for group in v.rsplitn(2, |num| *num % 3 == 0) { println!("{group:?}"); }
-
1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where +

1.0.0 · source

pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, T, F>
where F: FnMut(&T) -> bool,

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices.

The last element returned, if any, will contain the remainder of the slice.

-
Examples
+
§Examples
let mut s = [10, 40, 30, 20, 60, 50];
 
 for group in s.rsplitn_mut(2, |num| *num % 3 == 0) {
     group[0] = 1;
 }
 assert_eq!(s, [1, 40, 30, 20, 60, 1]);
-
source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

source

pub fn split_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the first element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix before the match and suffix after. The matching element itself is not included. If no elements match, returns None.

-
Examples
+
§Examples
#![feature(slice_split_once)]
 let s = [1, 2, 3, 2, 4];
 assert_eq!(s.split_once(|&x| x == 2), Some((
@@ -1322,13 +1167,13 @@ included. If no elements match, returns None.

&[3, 2, 4][..] ))); assert_eq!(s.split_once(|&x| x == 0), None);
-
source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where +

source

pub fn rsplit_once<F>(&self, pred: F) -> Option<(&[T], &[T])>
where F: FnMut(&T) -> bool,

🔬This is a nightly-only experimental API. (slice_split_once)

Splits the slice on the last element that matches the specified predicate.

If any matching elements are present in the slice, returns the prefix before the match and suffix after. The matching element itself is not included. If no elements match, returns None.

-
Examples
+
§Examples
#![feature(slice_split_once)]
 let s = [1, 2, 3, 2, 4];
 assert_eq!(s.rsplit_once(|&x| x == 2), Some((
@@ -1336,11 +1181,11 @@ included. If no elements match, returns None.

&[4][..] ))); assert_eq!(s.rsplit_once(|&x| x == 0), None);
-
1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where +

1.0.0 · source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Returns true if the slice contains an element with the given value.

This operation is O(n).

Note that if you have a sorted slice, binary_search may be faster.

-
Examples
+
§Examples
let v = [10, 40, 30];
 assert!(v.contains(&30));
 assert!(!v.contains(&50));
@@ -1351,12 +1196,13 @@ use iter().any:

let v = [String::from("hello"), String::from("world")]; // slice of `String`
 assert!(v.iter().any(|e| e == "hello")); // search with `&str`
 assert!(!v.iter().any(|e| e == "hi"));
-
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where - T: PartialEq,

Returns true if needle is a prefix of the slice.

-
Examples
+
1.0.0 · source

pub fn starts_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a prefix of the slice or equal to the slice.

+
§Examples
let v = [10, 40, 30];
 assert!(v.starts_with(&[10]));
 assert!(v.starts_with(&[10, 40]));
+assert!(v.starts_with(&v));
 assert!(!v.starts_with(&[50]));
 assert!(!v.starts_with(&[10, 50]));

Always returns true if needle is an empty slice:

@@ -1365,12 +1211,13 @@ use iter().any:

assert!(v.starts_with(&[])); let v: &[u8] = &[]; assert!(v.starts_with(&[]));
-
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where - T: PartialEq,

Returns true if needle is a suffix of the slice.

-
Examples
+
1.0.0 · source

pub fn ends_with(&self, needle: &[T]) -> bool
where + T: PartialEq,

Returns true if needle is a suffix of the slice or equal to the slice.

+
§Examples
let v = [10, 40, 30];
 assert!(v.ends_with(&[30]));
 assert!(v.ends_with(&[40, 30]));
+assert!(v.ends_with(&v));
 assert!(!v.ends_with(&[50]));
 assert!(!v.ends_with(&[50, 30]));

Always returns true if needle is an empty slice:

@@ -1379,35 +1226,39 @@ use iter().any:

assert!(v.ends_with(&[])); let v: &[u8] = &[]; assert!(v.ends_with(&[]));
-
1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where +

1.51.0 · source

pub fn strip_prefix<P>(&self, prefix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the prefix removed.

If the slice starts with prefix, returns the subslice after the prefix, wrapped in Some. -If prefix is empty, simply returns the original slice.

+If prefix is empty, simply returns the original slice. If prefix is equal to the +original slice, returns an empty slice.

If the slice does not start with prefix, returns None.

-
Examples
+
§Examples
let v = &[10, 40, 30];
 assert_eq!(v.strip_prefix(&[10]), Some(&[40, 30][..]));
 assert_eq!(v.strip_prefix(&[10, 40]), Some(&[30][..]));
+assert_eq!(v.strip_prefix(&[10, 40, 30]), Some(&[][..]));
 assert_eq!(v.strip_prefix(&[50]), None);
 assert_eq!(v.strip_prefix(&[10, 50]), None);
 
 let prefix : &str = "he";
 assert_eq!(b"hello".strip_prefix(prefix.as_bytes()),
            Some(b"llo".as_ref()));
-
1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where +

1.51.0 · source

pub fn strip_suffix<P>(&self, suffix: &P) -> Option<&[T]>
where P: SlicePattern<Item = T> + ?Sized, T: PartialEq,

Returns a subslice with the suffix removed.

If the slice ends with suffix, returns the subslice before the suffix, wrapped in Some. -If suffix is empty, simply returns the original slice.

+If suffix is empty, simply returns the original slice. If suffix is equal to the +original slice, returns an empty slice.

If the slice does not end with suffix, returns None.

-
Examples
+
§Examples
let v = &[10, 40, 30];
 assert_eq!(v.strip_suffix(&[30]), Some(&[10, 40][..]));
 assert_eq!(v.strip_suffix(&[40, 30]), Some(&[10][..]));
+assert_eq!(v.strip_suffix(&[10, 40, 30]), Some(&[][..]));
 assert_eq!(v.strip_suffix(&[50]), None);
 assert_eq!(v.strip_suffix(&[50, 30]), None);
-

Binary searches this slice for a given element. If the slice is not sorted, the returned result is unspecified and meaningless.

@@ -1419,7 +1270,7 @@ If the value is not found then binary_search_by, binary_search_by_key, and partition_point.

-
Examples
+
§Examples

Looks up a series of four elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in [1, 4].

@@ -1456,11 +1307,13 @@ sort order, consider using
let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
 let num = 42;
-let idx = s.partition_point(|&x| x < num);
-// The above is equivalent to `let idx = s.binary_search(&num).unwrap_or_else(|x| x);`
+let idx = s.partition_point(|&x| x <= num);
+// If `num` is unique, `s.partition_point(|&x| x < num)` (with `<`) is equivalent to
+// `s.binary_search(&num).unwrap_or_else(|x| x)`, but using `<=` will allow `insert`
+// to shift less elements.
 s.insert(idx, num);
 assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where +

1.0.0 · source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<usize, usize>
where F: FnMut(&'a T) -> Ordering,

Binary searches this slice with a comparator function.

The comparator function should return an order code that indicates whether its argument is Less, Equal or Greater the desired @@ -1476,7 +1329,7 @@ If the value is not found then binary_search, binary_search_by_key, and partition_point.

-
Examples
+
§Examples

Looks up a series of four elements. The first is found, with a uniquely determined position; the second and third are not found; the fourth could match any position in [1, 4].

@@ -1492,7 +1345,7 @@ found; the fourth could match any position in [1, 4].

let seek = 1; let r = s.binary_search_by(|probe| probe.cmp(&seek)); assert!(match r { Ok(1..=4) => true, _ => false, });
-
1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( +

1.10.0 · source

pub fn binary_search_by_key<'a, B, F>( &'a self, b: &B, f: F @@ -1511,7 +1364,7 @@ If the value is not found then binary_search, binary_search_by, and partition_point.

-

Examples
+
§Examples

Looks up a series of four elements in a slice of pairs sorted by their second elements. The first is found, with a uniquely determined position; the second and third are not found; the @@ -1526,11 +1379,11 @@ fourth could match any position in [1, 4].

assert_eq!(s.binary_search_by_key(&100, |&(a, b)| b), Err(13)); let r = s.binary_search_by_key(&1, |&(a, b)| b); assert!(match r { Ok(1..=4) => true, _ => false, }); -
1.20.0 · source

pub fn sort_unstable(&mut self)
where +

1.20.0 · source

pub fn sort_unstable(&mut self)
where T: Ord,

Sorts the slice, but might not preserve the order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(n * log(n)) worst-case.

-
Current implementation
+
§Current implementation

The current algorithm is based on pattern-defeating quicksort by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some @@ -1538,12 +1391,12 @@ randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior.

It is typically faster than stable sorting, except in a few special cases, e.g., when the slice consists of several concatenated sorted sequences.

-
Examples
+
§Examples
let mut v = [-5, 4, 1, -3, 2];
 
 v.sort_unstable();
 assert!(v == [-5, -3, 1, 2, 4]);
-
1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where +

1.20.0 · source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Sorts the slice with a comparator function, but might not preserve the order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place @@ -1561,7 +1414,7 @@ total order if it is (for all a, b and c)

let mut floats = [5f64, 4.0, 1.0, 3.0, 2.0];
 floats.sort_unstable_by(|a, b| a.partial_cmp(b).unwrap());
 assert_eq!(floats, [1.0, 2.0, 3.0, 4.0, 5.0]);
-
Current implementation
+
§Current implementation

The current algorithm is based on pattern-defeating quicksort by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some @@ -1569,7 +1422,7 @@ randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior.

It is typically faster than stable sorting, except in a few special cases, e.g., when the slice consists of several concatenated sorted sequences.

-
Examples
+
§Examples
let mut v = [5, 4, 1, 3, 2];
 v.sort_unstable_by(|a, b| a.cmp(b));
 assert!(v == [1, 2, 3, 4, 5]);
@@ -1577,14 +1430,14 @@ v.sort_unstable_by(|a, b| a.cmp(b));
 // reverse sorting
 v.sort_unstable_by(|a, b| b.cmp(a));
 assert!(v == [5, 4, 3, 2, 1]);
-
1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where +

1.20.0 · source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Sorts the slice with a key extraction function, but might not preserve the order of equal elements.

This sort is unstable (i.e., may reorder equal elements), in-place (i.e., does not allocate), and O(m * n * log(n)) worst-case, where the key function is O(m).

-
Current implementation
+
§Current implementation

The current algorithm is based on pattern-defeating quicksort by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some @@ -1593,16 +1446,16 @@ deterministic behavior.

Due to its key calling strategy, sort_unstable_by_key is likely to be slower than sort_by_cached_key in cases where the key function is expensive.

-
Examples
+
§Examples
let mut v = [-5i32, 4, 1, -3, 2];
 
 v.sort_unstable_by_key(|k| k.abs());
 assert!(v == [1, 2, -3, 4, -5]);
-
1.49.0 · source

pub fn select_nth_unstable( +

1.49.0 · source

pub fn select_nth_unstable( &mut self, index: usize ) -> (&mut [T], &mut T, &mut [T])
where - T: Ord,

Reorder the slice such that the element at index is at its final sorted position.

+ T: Ord,

Reorder the slice such that the element at index after the reordering is at its final sorted position.

This reordering has the additional property that any value at position i < index will be less than or equal to any value at a position j > index. Additionally, this reordering is unstable (i.e. any number of equal elements may end up at position index), in-place @@ -1612,17 +1465,22 @@ This function is also known as “kth element” in other libraries.

the subslice prior to index, the element at index, and the subslice after index; accordingly, the values in those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

-
Current implementation
+
§Current implementation

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime for all inputs.

-
Panics
+
§Panics

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
 
-// Find the median
-v.select_nth_unstable(2);
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median.
+let (lesser, median, greater) = v.select_nth_unstable(2);
+
+assert!(lesser == [-3, -5] || lesser == [-5, -3]);
+assert_eq!(median, &mut 1);
+assert!(greater == [4, 2] || greater == [2, 4]);
 
 // We are only guaranteed the slice will be one of the following, based on the way we sort
 // about the specified index.
@@ -1630,13 +1488,13 @@ pivot selection, which guarantees linear runtime for all inputs.

v == [-5, -3, 1, 2, 4] || v == [-3, -5, 1, 4, 2] || v == [-5, -3, 1, 4, 2]);
-
1.49.0 · source

pub fn select_nth_unstable_by<F>( +

1.49.0 · source

pub fn select_nth_unstable_by<F>( &mut self, index: usize, compare: F ) -> (&mut [T], &mut T, &mut [T])
where - F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index is at its -final sorted position.

+ F: FnMut(&T, &T) -> Ordering,

Reorder the slice with a comparator function such that the element at index after the reordering is at +its final sorted position.

This reordering has the additional property that any value at position i < index will be less than or equal to any value at a position j > index using the comparator function. Additionally, this reordering is unstable (i.e. any number of equal elements may end up at @@ -1647,17 +1505,22 @@ the slice reordered according to the provided comparator function: the subslice index, the element at index, and the subslice after index; accordingly, the values in those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

-
Current implementation
+
§Current implementation

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime for all inputs.

-
Panics
+
§Panics

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
-
let mut v = [-5i32, 4, 1, -3, 2];
+
§Examples
+
let mut v = [-5i32, 4, 2, -3, 1];
 
-// Find the median as if the slice were sorted in descending order.
-v.select_nth_unstable_by(2, |a, b| b.cmp(a));
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted in descending order.
+let (lesser, median, greater) = v.select_nth_unstable_by(2, |a, b| b.cmp(a));
+
+assert!(lesser == [4, 2] || lesser == [2, 4]);
+assert_eq!(median, &mut 1);
+assert!(greater == [-3, -5] || greater == [-5, -3]);
 
 // We are only guaranteed the slice will be one of the following, based on the way we sort
 // about the specified index.
@@ -1665,14 +1528,14 @@ pivot selection, which guarantees linear runtime for all inputs.

v == [2, 4, 1, -3, -5] || v == [4, 2, 1, -5, -3] || v == [4, 2, 1, -3, -5]);
-
1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>( +

1.49.0 · source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: usize, f: F ) -> (&mut [T], &mut T, &mut [T])
where F: FnMut(&T) -> K, - K: Ord,

Reorder the slice with a key extraction function such that the element at index is at its -final sorted position.

+ K: Ord,

Reorder the slice with a key extraction function such that the element at index after the reordering is +at its final sorted position.

This reordering has the additional property that any value at position i < index will be less than or equal to any value at a position j > index using the key extraction function. Additionally, this reordering is unstable (i.e. any number of equal elements may end up at @@ -1683,17 +1546,22 @@ the slice reordered according to the provided key extraction function: the subsl index, the element at index, and the subslice after index; accordingly, the values in those two subslices will respectively all be less-than-or-equal-to and greater-than-or-equal-to the value of the element at index.

-
Current implementation
+
§Current implementation

The current algorithm is an introselect implementation based on Pattern Defeating Quicksort, which is also the basis for sort_unstable. The fallback algorithm is Median of Medians using Tukey’s Ninther for pivot selection, which guarantees linear runtime for all inputs.

-
Panics
+
§Panics

Panics when index >= len(), meaning it always panics on empty slices.

-
Examples
+
§Examples
let mut v = [-5i32, 4, 1, -3, 2];
 
-// Return the median as if the array were sorted according to absolute value.
-v.select_nth_unstable_by_key(2, |a| a.abs());
+// Find the items less than or equal to the median, the median, and greater than or equal to
+// the median as if the slice were sorted according to absolute value.
+let (lesser, median, greater) = v.select_nth_unstable_by_key(2, |a| a.abs());
+
+assert!(lesser == [1, 2] || lesser == [2, 1]);
+assert_eq!(median, &mut -3);
+assert!(greater == [4, -5] || greater == [-5, 4]);
 
 // We are only guaranteed the slice will be one of the following, based on the way we sort
 // about the specified index.
@@ -1701,13 +1569,13 @@ pivot selection, which guarantees linear runtime for all inputs.

v == [1, 2, -3, -5, 4] || v == [2, 1, -3, 4, -5] || v == [2, 1, -3, -5, 4]);
-
source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where +

source

pub fn partition_dedup(&mut self) -> (&mut [T], &mut [T])
where T: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all consecutive repeated elements to the end of the slice according to the PartialEq trait implementation.

Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order.

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
+
§Examples
#![feature(slice_partition_dedup)]
 
 let mut slice = [1, 2, 2, 3, 3, 2, 1, 1];
@@ -1716,7 +1584,7 @@ The second contains all the duplicates in no specified order.

assert_eq!(dedup, [1, 2, 3, 2, 1]); assert_eq!(duplicates, [2, 3, 1]);
-
source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where +

source

pub fn partition_dedup_by<F>(&mut self, same_bucket: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T, &mut T) -> bool,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice satisfying a given equality relation.

Returns two slices. The first contains no consecutive repeated elements. @@ -1726,7 +1594,7 @@ must determine if the elements compare equal. The elements are passed in opposit from their order in the slice, so if same_bucket(a, b) returns true, a is moved at the end of the slice.

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
+
§Examples
#![feature(slice_partition_dedup)]
 
 let mut slice = ["foo", "Foo", "BAZ", "Bar", "bar", "baz", "BAZ"];
@@ -1735,14 +1603,14 @@ at the end of the slice.

assert_eq!(dedup, ["foo", "BAZ", "Bar", "baz"]); assert_eq!(duplicates, ["bar", "Foo", "BAZ"]);
-
source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where +

source

pub fn partition_dedup_by_key<K, F>(&mut self, key: F) -> (&mut [T], &mut [T])
where F: FnMut(&mut T) -> K, K: PartialEq,

🔬This is a nightly-only experimental API. (slice_partition_dedup)

Moves all but the first of consecutive elements to the end of the slice that resolve to the same key.

Returns two slices. The first contains no consecutive repeated elements. The second contains all the duplicates in no specified order.

If the slice is sorted, the first returned slice contains no duplicates.

-
Examples
+
§Examples
#![feature(slice_partition_dedup)]
 
 let mut slice = [10, 20, 21, 30, 30, 20, 11, 13];
@@ -1751,17 +1619,17 @@ The second contains all the duplicates in no specified order.

assert_eq!(dedup, [10, 20, 30, 20, 11]); assert_eq!(duplicates, [21, 30, 13]);
-
1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the +

1.26.0 · source

pub fn rotate_left(&mut self, mid: usize)

Rotates the slice in-place such that the first mid elements of the slice move to the end while the last self.len() - mid elements move to the front. After calling rotate_left, the element previously at index mid will become the first element in the slice.

-
Panics
+
§Panics

This function will panic if mid is greater than the length of the slice. Note that mid == self.len() does not panic and is a no-op rotation.

-
Complexity
+
§Complexity

Takes linear (in self.len()) time.

-
Examples
+
§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a.rotate_left(2);
 assert_eq!(a, ['c', 'd', 'e', 'f', 'a', 'b']);
@@ -1770,17 +1638,17 @@ a.rotate_left(2);
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_left(1);
 assert_eq!(a, ['a', 'c', 'd', 'e', 'b', 'f']);
-
1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k +

1.26.0 · source

pub fn rotate_right(&mut self, k: usize)

Rotates the slice in-place such that the first self.len() - k elements of the slice move to the end while the last k elements move to the front. After calling rotate_right, the element previously at index self.len() - k will become the first element in the slice.

-
Panics
+
§Panics

This function will panic if k is greater than the length of the slice. Note that k == self.len() does not panic and is a no-op rotation.

-
Complexity
+
§Complexity

Takes linear (in self.len()) time.

-
Examples
+
§Examples
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a.rotate_right(2);
 assert_eq!(a, ['e', 'f', 'a', 'b', 'c', 'd']);
@@ -1789,28 +1657,28 @@ a.rotate_right(2);
let mut a = ['a', 'b', 'c', 'd', 'e', 'f'];
 a[1..5].rotate_right(1);
 assert_eq!(a, ['a', 'e', 'b', 'c', 'd', 'f']);
-
1.50.0 · source

pub fn fill(&mut self, value: T)
where +

1.50.0 · source

pub fn fill(&mut self, value: T)
where T: Clone,

Fills self with elements by cloning value.

-
Examples
+
§Examples
let mut buf = vec![0; 10];
 buf.fill(1);
 assert_eq!(buf, vec![1; 10]);
-
1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where +

1.51.0 · source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Fills self with elements returned by calling a closure repeatedly.

This method uses a closure to create new values. If you’d rather Clone a given value, use fill. If you want to use the Default trait to generate values, you can pass Default::default as the argument.

-
Examples
+
§Examples
let mut buf = vec![1; 10];
 buf.fill_with(Default::default);
 assert_eq!(buf, vec![0; 10]);
-
1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where +

1.7.0 · source

pub fn clone_from_slice(&mut self, src: &[T])
where T: Clone,

Copies the elements from src into self.

The length of src must be the same as self.

-
Panics
+
§Panics

This function will panic if the two slices have different lengths.

-
Examples
+
§Examples

Cloning two elements from a slice into another:

let src = [1, 2, 3, 4];
@@ -1842,13 +1710,13 @@ sub-slices from a slice:

} assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where +

1.9.0 · source

pub fn copy_from_slice(&mut self, src: &[T])
where T: Copy,

Copies all elements from src into self, using a memcpy.

The length of src must be the same as self.

If T does not implement Copy, use clone_from_slice.

-
Panics
+
§Panics

This function will panic if the two slices have different lengths.

-
Examples
+
§Examples

Copying two elements from a slice into another:

let src = [1, 2, 3, 4];
@@ -1880,7 +1748,7 @@ sub-slices from a slice:

} assert_eq!(slice, [4, 5, 3, 4, 5]);
-
1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where +

1.37.0 · source

pub fn copy_within<R>(&mut self, src: R, dest: usize)
where R: RangeBounds<usize>, T: Copy,

Copies elements from one part of the slice to another part of itself, using a memmove.

@@ -1888,10 +1756,10 @@ using a memmove.

index of the range within self to copy to, which will have the same length as src. The two ranges may overlap. The ends of the two ranges must be less than or equal to self.len().

-
Panics
+
§Panics

This function will panic if either range exceeds the end of the slice, or if the end of src is before the start.

-
Examples
+
§Examples

Copying four bytes within a slice:

let mut bytes = *b"Hello, World!";
@@ -1899,11 +1767,11 @@ or if the end of src is before the start.

bytes.copy_within(1..5, 8); assert_eq!(&bytes, b"Hello, Wello!");
-
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

+
1.27.0 · source

pub fn swap_with_slice(&mut self, other: &mut [T])

Swaps all elements in self with those in other.

The length of other must be the same as self.

-
Panics
+
§Panics

This function will panic if the two slices have different lengths.

-
Example
+
§Example

Swapping two elements across slices:

let mut slice1 = [0, 0];
@@ -1931,20 +1799,17 @@ mutable sub-slices from a slice:

} assert_eq!(slice, [4, 5, 3, 1, 2]);
-
1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is +

1.30.0 · source

pub unsafe fn align_to<U>(&self) -> (&[T], &[U], &[T])

Transmute the slice to a slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

+slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

This method has no purpose when either input element T or output element U are zero-sized and will return the original slice without splitting anything.

-
Safety
+
§Safety

This method is essentially a transmute with respect to the elements in the returned middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
+
§Examples

Basic usage:

unsafe {
@@ -1954,20 +1819,17 @@ middle slice, so all the usual caveats pertaining to transmute::<T, U&g
     // more_efficient_algorithm_for_aligned_shorts(shorts);
     // less_efficient_algorithm_for_bytes(suffix);
 }
-
1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the +

1.30.0 · source

pub unsafe fn align_to_mut<U>(&mut self) -> (&mut [T], &mut [U], &mut [T])

Transmute the mutable slice to a mutable slice of another type, ensuring alignment of the types is maintained.

This method splits the slice into three distinct slices: prefix, correctly aligned middle -slice of a new type, and the suffix slice. How exactly the slice is split up is not -specified; the middle part may be smaller than necessary. However, if this fails to return a -maximal middle part, that is because code is running in a context where performance does not -matter, such as a sanitizer attempting to find alignment bugs. Regular code running -in a default (debug or release) execution will return a maximal middle part.

+slice of a new type, and the suffix slice. The middle part will be as big as possible under +the given alignment constraint and element size.

This method has no purpose when either input element T or output element U are zero-sized and will return the original slice without splitting anything.

-
Safety
+
§Safety

This method is essentially a transmute with respect to the elements in the returned middle slice, so all the usual caveats pertaining to transmute::<T, U> also apply here.

-
Examples
+
§Examples

Basic usage:

unsafe {
@@ -1977,7 +1839,7 @@ middle slice, so all the usual caveats pertaining to transmute::<T, U&g
     // more_efficient_algorithm_for_aligned_shorts(shorts);
     // less_efficient_algorithm_for_bytes(suffix);
 }
-
source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])
where +

source

pub fn as_simd<const LANES: usize>(&self) -> (&[T], &[Simd<T, LANES>], &[T])

🔬This is a nightly-only experimental API. (portable_simd)

Split a slice into a prefix, a middle of aligned SIMD types, and a suffix.

@@ -1992,7 +1854,7 @@ postconditions as that method. You’re only assured that

That said, this is a safe method, so if you’re only writing safe code, then this can at most cause incorrect logic, not unsoundness.

-
Panics
+
§Panics

This will panic if the size of the SIMD type is different from LANES times that of the scalar.

At the time of writing, the trait restrictions on Simd<T, LANES> keeps @@ -2000,7 +1862,7 @@ that from ever happening, as only power-of-two numbers of lanes are supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-
Examples
+
§Examples
#![feature(portable_simd)]
 use core::simd::prelude::*;
 
@@ -2027,7 +1889,7 @@ method for something like LANES == 3.

let numbers: Vec<f32> = (1..101).map(|x| x as _).collect(); assert_eq!(basic_simd_sum(&numbers[1..99]), 4949.0);
-
source

pub fn as_simd_mut<const LANES: usize>( +

source

pub fn as_simd_mut<const LANES: usize>( &mut self ) -> (&mut [T], &mut [Simd<T, LANES>], &mut [T])
where Simd<T, LANES>: AsMut<[T; LANES]>, @@ -2046,7 +1908,7 @@ postconditions as that method. You’re only assured that

That said, this is a safe method, so if you’re only writing safe code, then this can at most cause incorrect logic, not unsoundness.

This is the mutable version of slice::as_simd; see that for examples.

-
Panics
+
§Panics

This will panic if the size of the SIMD type is different from LANES times that of the scalar.

At the time of writing, the trait restrictions on Simd<T, LANES> keeps @@ -2054,14 +1916,14 @@ that from ever happening, as only power-of-two numbers of lanes are supported. It’s possible that, in the future, those restrictions might be lifted in a way that would make it possible to see panics from this method for something like LANES == 3.

-

source

pub fn is_sorted(&self) -> bool
where +

source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted.

That is, for each element a and its following element b, a <= b must hold. If the slice yields exactly zero or one element, true is returned.

Note that if Self::Item is only PartialOrd, but not Ord, the above definition implies that this function returns false if any two consecutive items are not comparable.

-
Examples
+
§Examples
#![feature(is_sorted)]
 let empty: [i32; 0] = [];
 
@@ -2070,23 +1932,34 @@ comparable.

assert!([0].is_sorted()); assert!(empty.is_sorted()); assert!(![0.0, 1.0, f32::NAN].is_sorted());
-
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where - F: FnMut(&'a T, &'a T) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

+
source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where + F: FnMut(&'a T, &'a T) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given comparator function.

Instead of using PartialOrd::partial_cmp, this function uses the given compare -function to determine the ordering of two elements. Apart from that, it’s equivalent to -is_sorted; see its documentation for more information.

-
source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where +function to determine whether two elements are to be considered in sorted order.

+
§Examples
+
#![feature(is_sorted)]
+
+assert!([1, 2, 2, 9].is_sorted_by(|a, b| a <= b));
+assert!(![1, 2, 2, 9].is_sorted_by(|a, b| a < b));
+
+assert!([0].is_sorted_by(|a, b| true));
+assert!([0].is_sorted_by(|a, b| false));
+
+let empty: [i32; 0] = [];
+assert!(empty.is_sorted_by(|a, b| false));
+assert!(empty.is_sorted_by(|a, b| true));
+

source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)

Checks if the elements of this slice are sorted using the given key extraction function.

Instead of comparing the slice’s elements directly, this function compares the keys of the elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see its documentation for more information.

-
Examples
+
§Examples
#![feature(is_sorted)]
 
 assert!(["c", "bb", "aaa"].is_sorted_by_key(|s| s.len()));
 assert!(![-2i32, -1, 0, 3].is_sorted_by_key(|n| n.abs()));
-
1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where +

1.52.0 · source

pub fn partition_point<P>(&self, pred: P) -> usize
where P: FnMut(&T) -> bool,

Returns the index of the partition point according to the given predicate (the index of the first element of the second partition).

The slice is assumed to be partitioned according to the given predicate. @@ -2097,7 +1970,7 @@ For example, [7, 15, 3, 5, 4, 12, 6] is partitioned under the predi

If this slice is not partitioned, the returned result is unspecified and meaningless, as this method performs a kind of binary search.

See also binary_search, binary_search_by, and binary_search_by_key.

-
Examples
+
§Examples
let v = [1, 2, 3, 3, 5, 6, 7];
 let i = v.partition_point(|&x| x < 5);
 
@@ -2116,17 +1989,17 @@ sort order:

let mut s = vec![0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55];
 let num = 42;
-let idx = s.partition_point(|&x| x < num);
+let idx = s.partition_point(|&x| x <= num);
 s.insert(idx, num);
 assert_eq!(s, [0, 1, 1, 1, 1, 2, 3, 5, 8, 13, 21, 34, 42, 55]);
-
source

pub fn take<R, 'a>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where +

source

pub fn take<'a, R>(self: &mut &'a [T], range: R) -> Option<&'a [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a reference to it.

Returns None and does not modify the slice if the given range is out of bounds.

Note that this method only accepts one-sided ranges such as 2.. or ..6, but not 2..6.

-
Examples
+
§Examples

Taking the first three elements of a slice:

#![feature(slice_take)]
@@ -2156,14 +2029,14 @@ range is out of bounds.

assert_eq!(None, slice.take(..=4)); let expected: &[char] = &['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take(..4));
-
source

pub fn take_mut<R, 'a>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where +

source

pub fn take_mut<'a, R>(self: &mut &'a mut [T], range: R) -> Option<&'a mut [T]>
where R: OneSidedRange<usize>,

🔬This is a nightly-only experimental API. (slice_take)

Removes the subslice corresponding to the given range and returns a mutable reference to it.

Returns None and does not modify the slice if the given range is out of bounds.

Note that this method only accepts one-sided ranges such as 2.. or ..6, but not 2..6.

-
Examples
+
§Examples

Taking the first three elements of a slice:

#![feature(slice_take)]
@@ -2193,10 +2066,10 @@ range is out of bounds.

assert_eq!(None, slice.take_mut(..=4)); let expected: &mut [_] = &mut ['a', 'b', 'c', 'd']; assert_eq!(Some(expected), slice.take_mut(..4));
-
source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference +

source

pub fn take_first<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a reference to it.

Returns None if the slice is empty.

-
Examples
+
§Examples
#![feature(slice_take)]
 
 let mut slice: &[_] = &['a', 'b', 'c'];
@@ -2204,10 +2077,10 @@ to it.

assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'a');
-
source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable +

source

pub fn take_first_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the first element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

-
Examples
+
§Examples
#![feature(slice_take)]
 
 let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
@@ -2216,10 +2089,10 @@ reference to it.

assert_eq!(slice, &['b', 'c']); assert_eq!(first, &'d');
-
source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference +

source

pub fn take_last<'a>(self: &mut &'a [T]) -> Option<&'a T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a reference to it.

Returns None if the slice is empty.

-
Examples
+
§Examples
#![feature(slice_take)]
 
 let mut slice: &[_] = &['a', 'b', 'c'];
@@ -2227,10 +2100,10 @@ to it.

assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'c');
-
source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable +

source

pub fn take_last_mut<'a>(self: &mut &'a mut [T]) -> Option<&'a mut T>

🔬This is a nightly-only experimental API. (slice_take)

Removes the last element of the slice and returns a mutable reference to it.

Returns None if the slice is empty.

-
Examples
+
§Examples
#![feature(slice_take)]
 
 let mut slice: &mut [_] = &mut ['a', 'b', 'c'];
@@ -2239,15 +2112,15 @@ reference to it.

assert_eq!(slice, &['a', 'b']); assert_eq!(last, &'d');
-
source

pub unsafe fn get_many_unchecked_mut<const N: usize>( +

source

pub unsafe fn get_many_unchecked_mut<const N: usize>( &mut self, indices: [usize; N] ) -> [&mut T; N]

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once, without doing any checks.

For a safe alternative see get_many_mut.

-
Safety
+
§Safety

Calling this method with overlapping or out-of-bounds indices is undefined behavior even if the resulting references are not used.

-
Examples
+
§Examples
#![feature(get_many_mut)]
 
 let x = &mut [1, 2, 4];
@@ -2258,13 +2131,13 @@ even if the resulting references are not used.

*b *= 100; } assert_eq!(x, &[10, 2, 400]);
-
source

pub fn get_many_mut<const N: usize>( +

source

pub fn get_many_mut<const N: usize>( &mut self, indices: [usize; N] ) -> Result<[&mut T; N], GetManyMutError<N>>

🔬This is a nightly-only experimental API. (get_many_mut)

Returns mutable references to many indices at once.

Returns an error if any index is out-of-bounds, or if the same index was passed more than once.

-
Examples
+
§Examples
#![feature(get_many_mut)]
 
 let v = &mut [1, 2, 3];
@@ -2273,8 +2146,157 @@ passed more than once.

*b = 612; } assert_eq!(v, &[413, 2, 612]);
-
source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

-
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

+
1.23.0 · source

pub fn is_ascii(&self) -> bool

Checks if all bytes in this slice are within the ASCII range.

+
source

pub fn as_ascii(&self) -> Option<&[AsciiChar]>

🔬This is a nightly-only experimental API. (ascii_char)

If this slice is_ascii, returns it as a slice of +ASCII characters, otherwise returns None.

+
source

pub unsafe fn as_ascii_unchecked(&self) -> &[AsciiChar]

🔬This is a nightly-only experimental API. (ascii_char)

Converts this slice of bytes into a slice of ASCII characters, +without checking whether they’re valid.

+
§Safety
+

Every byte in the slice must be in 0..=127, or else this is UB.

+
1.23.0 · source

pub fn eq_ignore_ascii_case(&self, other: &[u8]) -> bool

Checks that two slices are an ASCII case-insensitive match.

+

Same as to_ascii_lowercase(a) == to_ascii_lowercase(b), +but without allocating and copying temporaries.

+
1.23.0 · source

pub fn make_ascii_uppercase(&mut self)

Converts this slice to its ASCII upper case equivalent in-place.

+

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, +but non-ASCII letters are unchanged.

+

To return a new uppercased value without modifying the existing one, use +to_ascii_uppercase.

+
1.23.0 · source

pub fn make_ascii_lowercase(&mut self)

Converts this slice to its ASCII lower case equivalent in-place.

+

ASCII letters ‘A’ to ‘Z’ are mapped to ‘a’ to ‘z’, +but non-ASCII letters are unchanged.

+

To return a new lowercased value without modifying the existing one, use +to_ascii_lowercase.

+
1.60.0 · source

pub fn escape_ascii(&self) -> EscapeAscii<'_>

Returns an iterator that produces an escaped version of this slice, +treating it as an ASCII string.

+
§Examples
+

+let s = b"0\t\r\n'\"\\\x9d";
+let escaped = s.escape_ascii().to_string();
+assert_eq!(escaped, "0\\t\\r\\n\\'\\\"\\\\\\x9d");
+
source

pub fn trim_ascii_start(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
#![feature(byte_slice_trim_ascii)]
+
+assert_eq!(b" \t hello world\n".trim_ascii_start(), b"hello world\n");
+assert_eq!(b"  ".trim_ascii_start(), b"");
+assert_eq!(b"".trim_ascii_start(), b"");
+
source

pub fn trim_ascii_end(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with trailing ASCII whitespace bytes removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
#![feature(byte_slice_trim_ascii)]
+
+assert_eq!(b"\r hello world\n ".trim_ascii_end(), b"\r hello world");
+assert_eq!(b"  ".trim_ascii_end(), b"");
+assert_eq!(b"".trim_ascii_end(), b"");
+
source

pub fn trim_ascii(&self) -> &[u8]

🔬This is a nightly-only experimental API. (byte_slice_trim_ascii)

Returns a byte slice with leading and trailing ASCII whitespace bytes +removed.

+

‘Whitespace’ refers to the definition used by +u8::is_ascii_whitespace.

+
§Examples
+
#![feature(byte_slice_trim_ascii)]
+
+assert_eq!(b"\r hello world\n ".trim_ascii(), b"hello world");
+assert_eq!(b"  ".trim_ascii(), b"");
+assert_eq!(b"".trim_ascii(), b"");
+
source

pub fn flatten(&self) -> &[T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &[[T; N]], and flattens it to a &[T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
#![feature(slice_flatten)]
+
+assert_eq!([[1, 2, 3], [4, 5, 6]].flatten(), &[1, 2, 3, 4, 5, 6]);
+
+assert_eq!(
+    [[1, 2, 3], [4, 5, 6]].flatten(),
+    [[1, 2], [3, 4], [5, 6]].flatten(),
+);
+
+let slice_of_empty_arrays: &[[i32; 0]] = &[[], [], [], [], []];
+assert!(slice_of_empty_arrays.flatten().is_empty());
+
+let empty_slice_of_arrays: &[[u32; 10]] = &[];
+assert!(empty_slice_of_arrays.flatten().is_empty());
+
source

pub fn flatten_mut(&mut self) -> &mut [T]

🔬This is a nightly-only experimental API. (slice_flatten)

Takes a &mut [[T; N]], and flattens it to a &mut [T].

+
§Panics
+

This panics if the length of the resulting slice would overflow a usize.

+

This is only possible when flattening a slice of arrays of zero-sized +types, and thus tends to be irrelevant in practice. If +size_of::<T>() > 0, this will never panic.

+
§Examples
+
#![feature(slice_flatten)]
+
+fn add_5_to_all(slice: &mut [i32]) {
+    for i in slice {
+        *i += 5;
+    }
+}
+
+let mut array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]];
+add_5_to_all(array.flatten_mut());
+assert_eq!(array, [[6, 7, 8], [9, 10, 11], [12, 13, 14]]);
+
source

pub fn as_str(&self) -> &str

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a UTF-8 str.

+
source

pub fn as_bytes(&self) -> &[u8]

🔬This is a nightly-only experimental API. (ascii_char)

Views this slice of ASCII characters as a slice of u8 bytes.

+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f32::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f32::NAN, 8.29, f32::INFINITY, -1.0, 0.0, -f32::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f32::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f32::INFINITY, f32::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
+
1.80.0 · source

pub fn utf8_chunks(&self) -> Utf8Chunks<'_>

Creates an iterator over the contiguous valid UTF-8 ranges of this +slice, and the non-UTF-8 fragments in between.

+
§Examples
+

This function formats arbitrary but mostly-UTF-8 bytes into Rust source +code in the form of a C-string literal (c"...").

+ +
use std::fmt::Write as _;
+
+pub fn cstr_literal(bytes: &[u8]) -> String {
+    let mut repr = String::new();
+    repr.push_str("c\"");
+    for chunk in bytes.utf8_chunks() {
+        for ch in chunk.valid().chars() {
+            // Escapes \0, \t, \r, \n, \\, \', \", and uses \u{...} for non-printable characters.
+            write!(repr, "{}", ch.escape_debug()).unwrap();
+        }
+        for byte in chunk.invalid() {
+            write!(repr, "\\x{:02X}", byte).unwrap();
+        }
+    }
+    repr.push('"');
+    repr
+}
+
+fn main() {
+    let lit = cstr_literal(b"\xferris the \xf0\x9f\xa6\x80\x07");
+    let expected = stringify!(c"\xFErris the 🦀\u{7}");
+    assert_eq!(lit, expected);
+}
+
source

pub fn sort_floats(&mut self)

🔬This is a nightly-only experimental API. (sort_floats)

Sorts the slice of floats.

+

This sort is in-place (i.e. does not allocate), O(n * log(n)) worst-case, and uses +the ordering defined by f64::total_cmp.

+
§Current implementation
+

This uses the same sorting algorithm as sort_unstable_by.

+
§Examples
+
#![feature(sort_floats)]
+let mut v = [2.6, -5e-8, f64::NAN, 8.29, f64::INFINITY, -1.0, 0.0, -f64::INFINITY, -0.0];
+
+v.sort_floats();
+let sorted = [-f64::INFINITY, -1.0, -5e-8, -0.0, 0.0, 2.6, 8.29, f64::INFINITY, f64::NAN];
+assert_eq!(&v[..8], &sorted[..8]);
+assert!(v[8].is_nan());
1.23.0 · source

pub fn to_ascii_uppercase(&self) -> Vec<u8>

Returns a vector containing a copy of this slice where each byte is mapped to its ASCII upper case equivalent.

ASCII letters ‘a’ to ‘z’ are mapped to ‘A’ to ‘Z’, @@ -2291,14 +2313,14 @@ but non-ASCII letters are unchanged.

When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See sort_unstable.

-
Current implementation
+
§Current implementation

The current algorithm is an adaptive, iterative merge sort inspired by timsort. It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another.

Also, it allocates temporary storage half the size of self, but for short slices a non-allocating insertion sort is used instead.

-
Examples
+
§Examples
let mut v = [-5, 4, 1, -3, 2];
 
 v.sort();
@@ -2322,14 +2344,14 @@ floats.sort_by(|a, b| a.partial_cmp(b).unwrap());
 

When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See sort_unstable_by.

-
Current implementation
+
§Current implementation

The current algorithm is an adaptive, iterative merge sort inspired by timsort. It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another.

Also, it allocates temporary storage half the size of self, but for short slices a non-allocating insertion sort is used instead.

-
Examples
+
§Examples
let mut v = [5, 4, 1, 3, 2];
 v.sort_by(|a, b| a.cmp(b));
 assert!(v == [1, 2, 3, 4, 5]);
@@ -2348,14 +2370,14 @@ significantly faster, as it does not recompute element keys.

When applicable, unstable sorting is preferred because it is generally faster than stable sorting and it doesn’t allocate auxiliary memory. See sort_unstable_by_key.

-
Current implementation
+
§Current implementation

The current algorithm is an adaptive, iterative merge sort inspired by timsort. It is designed to be very fast in cases where the slice is nearly sorted, or consists of two or more sorted sequences concatenated one after another.

Also, it allocates temporary storage half the size of self, but for short slices a non-allocating insertion sort is used instead.

-
Examples
+
§Examples
let mut v = [-5i32, 4, 1, -3, 2];
 
 v.sort_by_key(|k| k.abs());
@@ -2372,7 +2394,7 @@ worst-case, where the key function is O(m).

For simple key functions (e.g., functions that are property accesses or basic operations), sort_by_key is likely to be faster.

-
Current implementation
+
§Current implementation

The current algorithm is based on pattern-defeating quicksort by Orson Peters, which combines the fast average case of randomized quicksort with the fast worst case of heapsort, while achieving linear time on slices with certain patterns. It uses some @@ -2380,21 +2402,21 @@ randomization to avoid degenerate cases, but with a fixed seed to always provide deterministic behavior.

In the worst case, the algorithm allocates temporary storage in a Vec<(K, usize)> the length of the slice.

-
Examples
+
§Examples
let mut v = [-5i32, 4, 32, -3, 2];
 
 v.sort_by_cached_key(|k| k.to_string());
 assert!(v == [-3, -5, 2, 32, 4]);
1.0.0 · source

pub fn to_vec(&self) -> Vec<T>
where T: Clone,

Copies self into a new Vec.

-
Examples
+
§Examples
let s = [10, 40, 30];
 let x = s.to_vec();
 // Here, `s` and `x` can be modified independently.
source

pub fn to_vec_in<A>(&self, alloc: A) -> Vec<T, A>
where A: Allocator, T: Clone,

🔬This is a nightly-only experimental API. (allocator_api)

Copies self into a new Vec with an allocator.

-
Examples
+
§Examples
#![feature(allocator_api)]
 
 use std::alloc::System;
@@ -2404,9 +2426,9 @@ v.sort_by_cached_key(|k| k.to_string());
 // Here, `s` and `x` can be modified independently.
1.40.0 · source

pub fn repeat(&self, n: usize) -> Vec<T>
where T: Copy,

Creates a vector by copying a slice n times.

-
Panics
+
§Panics

This function will panic if the capacity would overflow.

-
Examples
+
§Examples

Basic usage:

assert_eq!([1, 2].repeat(3), vec![1, 2, 1, 2, 1, 2]);
@@ -2417,7 +2439,7 @@ v.sort_by_cached_key(|k| k.to_string());
1.0.0 · source

pub fn concat<Item>(&self) -> <[T] as Concat<Item>>::Output
where [T]: Concat<Item>, Item: ?Sized,

Flattens a slice of T into a single value Self::Output.

-
Examples
+
§Examples
assert_eq!(["hello", "world"].concat(), "helloworld");
 assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]);
1.3.0 · source

pub fn join<Separator>( @@ -2426,7 +2448,7 @@ v.sort_by_cached_key(|k| k.to_string()); ) -> <[T] as Join<Separator>>::Output
where [T]: Join<Separator>,

Flattens a slice of T into a single value Self::Output, placing a given separator between each.

-
Examples
+
§Examples
assert_eq!(["hello", "world"].join(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].join(&0), [1, 2, 0, 3, 4]);
 assert_eq!([[1, 2], [3, 4]].join(&[0, 0][..]), [1, 2, 0, 0, 3, 4]);
@@ -2436,17 +2458,17 @@ given separator between each.

) -> <[T] as Join<Separator>>::Output
where [T]: Join<Separator>,
👎Deprecated since 1.3.0: renamed to join

Flattens a slice of T into a single value Self::Output, placing a given separator between each.

-
Examples
+
§Examples
assert_eq!(["hello", "world"].connect(" "), "hello world");
 assert_eq!([[1, 2], [3, 4]].connect(&0), [1, 2, 0, 3, 4]);
-

Trait Implementations§

source§

impl Deref for APP_NAMES

§

type Target = Vec<&'static str>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Vec<&'static str>

Dereferences the value.
source§

impl LazyStatic for APP_NAMES

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Deref for APP_NAMES

§

type Target = Vec<&'static str>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Vec<&'static str>

Dereferences the value.
source§

impl LazyStatic for APP_NAMES

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/macro.print.html b/ch5/os/macro.print.html index 96dac7ae..072405ee 100644 --- a/ch5/os/macro.print.html +++ b/ch5/os/macro.print.html @@ -1,5 +1,4 @@ -print in os - Rust -

Macro os::print

source ·
macro_rules! print {
+print in os - Rust

Macro os::print

source ·
macro_rules! print {
     ($fmt: literal $(, $($arg: tt)+)?) => { ... };
 }
Expand description

print string macro

\ No newline at end of file diff --git a/ch5/os/macro.println.html b/ch5/os/macro.println.html index 25a69150..0fe6b6c3 100644 --- a/ch5/os/macro.println.html +++ b/ch5/os/macro.println.html @@ -1,5 +1,4 @@ -println in os - Rust -

Macro os::println

source ·
macro_rules! println {
+println in os - Rust

Macro os::println

source ·
macro_rules! println {
     ($fmt: literal $(, $($arg: tt)+)?) => { ... };
 }
Expand description

println string macro

\ No newline at end of file diff --git a/ch5/os/mm/address/constant.PA_WIDTH_SV39.html b/ch5/os/mm/address/constant.PA_WIDTH_SV39.html index 2ffb8881..0d44f542 100644 --- a/ch5/os/mm/address/constant.PA_WIDTH_SV39.html +++ b/ch5/os/mm/address/constant.PA_WIDTH_SV39.html @@ -1,3 +1,2 @@ -PA_WIDTH_SV39 in os::mm::address - Rust -

Constant os::mm::address::PA_WIDTH_SV39

source ·
const PA_WIDTH_SV39: usize = 56;
Expand description

physical address

+PA_WIDTH_SV39 in os::mm::address - Rust

Constant os::mm::address::PA_WIDTH_SV39

source ·
const PA_WIDTH_SV39: usize = 56;
Expand description

physical address

\ No newline at end of file diff --git a/ch5/os/mm/address/constant.PPN_WIDTH_SV39.html b/ch5/os/mm/address/constant.PPN_WIDTH_SV39.html index f6d6a0c6..67b9f373 100644 --- a/ch5/os/mm/address/constant.PPN_WIDTH_SV39.html +++ b/ch5/os/mm/address/constant.PPN_WIDTH_SV39.html @@ -1,2 +1 @@ -PPN_WIDTH_SV39 in os::mm::address - Rust -

Constant os::mm::address::PPN_WIDTH_SV39

source ·
const PPN_WIDTH_SV39: usize = _; // 44usize
\ No newline at end of file +PPN_WIDTH_SV39 in os::mm::address - Rust

Constant os::mm::address::PPN_WIDTH_SV39

source ·
const PPN_WIDTH_SV39: usize = _; // 44usize
\ No newline at end of file diff --git a/ch5/os/mm/address/constant.VA_WIDTH_SV39.html b/ch5/os/mm/address/constant.VA_WIDTH_SV39.html index e2ee0691..4c0df9a8 100644 --- a/ch5/os/mm/address/constant.VA_WIDTH_SV39.html +++ b/ch5/os/mm/address/constant.VA_WIDTH_SV39.html @@ -1,2 +1 @@ -VA_WIDTH_SV39 in os::mm::address - Rust -

Constant os::mm::address::VA_WIDTH_SV39

source ·
const VA_WIDTH_SV39: usize = 39;
\ No newline at end of file +VA_WIDTH_SV39 in os::mm::address - Rust

Constant os::mm::address::VA_WIDTH_SV39

source ·
const VA_WIDTH_SV39: usize = 39;
\ No newline at end of file diff --git a/ch5/os/mm/address/constant.VPN_WIDTH_SV39.html b/ch5/os/mm/address/constant.VPN_WIDTH_SV39.html index 1dc0b5b3..0c4d7397 100644 --- a/ch5/os/mm/address/constant.VPN_WIDTH_SV39.html +++ b/ch5/os/mm/address/constant.VPN_WIDTH_SV39.html @@ -1,2 +1 @@ -VPN_WIDTH_SV39 in os::mm::address - Rust -

Constant os::mm::address::VPN_WIDTH_SV39

source ·
const VPN_WIDTH_SV39: usize = _; // 27usize
\ No newline at end of file +VPN_WIDTH_SV39 in os::mm::address - Rust

Constant os::mm::address::VPN_WIDTH_SV39

source ·
const VPN_WIDTH_SV39: usize = _; // 27usize
\ No newline at end of file diff --git a/ch5/os/mm/address/index.html b/ch5/os/mm/address/index.html index 6bd87d97..5ba77294 100644 --- a/ch5/os/mm/address/index.html +++ b/ch5/os/mm/address/index.html @@ -1,3 +1,2 @@ -os::mm::address - Rust -

Module os::mm::address

source ·
Expand description

Implementation of physical and virtual address and page number.

-

Structs

Constants

Traits

Type Aliases

  • a simple range structure for virtual page number
\ No newline at end of file +os::mm::address - Rust

Module os::mm::address

source ·
Expand description

Implementation of physical and virtual address and page number.

+

Structs§

Constants§

Traits§

Type Aliases§

  • a simple range structure for virtual page number
\ No newline at end of file diff --git a/ch5/os/mm/address/struct.PhysAddr.html b/ch5/os/mm/address/struct.PhysAddr.html index 019ec8ba..f247c66e 100644 --- a/ch5/os/mm/address/struct.PhysAddr.html +++ b/ch5/os/mm/address/struct.PhysAddr.html @@ -1,29 +1,28 @@ -PhysAddr in os::mm::address - Rust -

Struct os::mm::address::PhysAddr

source ·
pub struct PhysAddr(pub usize);
Expand description

physical address

+PhysAddr in os::mm::address - Rust

Struct os::mm::address::PhysAddr

source ·
pub struct PhysAddr(pub usize);
Expand description

physical address

Tuple Fields§

§0: usize

Implementations§

source§

impl PhysAddr

source

pub fn floor(&self) -> PhysPageNum

PhysAddr->PhysPageNum

source

pub fn ceil(&self) -> PhysPageNum

PhysAddr->PhysPageNum

source

pub fn page_offset(&self) -> usize

Get page offset

source

pub fn aligned(&self) -> bool

Check page aligned

source§

impl PhysAddr

source

pub fn get_mut<T>(&self) -> &'static mut T

Get mutable reference to PhysAddr value

-

Trait Implementations§

source§

impl Clone for PhysAddr

source§

fn clone(&self) -> PhysAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysAddr> for usize

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysAddr

T: {PhysAddr, VirtAddr, PhysPageNum, VirtPageNum} +

Trait Implementations§

source§

impl Clone for PhysAddr

source§

fn clone(&self) -> PhysAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysAddr> for usize

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysAddr

T: {PhysAddr, VirtAddr, PhysPageNum, VirtPageNum} T -> usize: T.0 usize -> T: usize.into()

-
source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysAddr

source§

fn cmp(&self, other: &PhysAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +
source§

fn from(v: usize) -> Self

Converts to this type from the input type.

source§

impl Ord for PhysAddr

source§

fn cmp(&self, other: &PhysAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PhysAddr

source§

fn eq(&self, other: &PhysAddr) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysAddr

source§

fn partial_cmp(&self, other: &PhysAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for PhysAddr

source§

impl Eq for PhysAddr

source§

impl StructuralEq for PhysAddr

source§

impl StructuralPartialEq for PhysAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysAddr

source§

fn partial_cmp(&self, other: &PhysAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for PhysAddr

source§

impl Eq for PhysAddr

source§

impl StructuralPartialEq for PhysAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/address/struct.PhysPageNum.html b/ch5/os/mm/address/struct.PhysPageNum.html index d8c1314b..4b18f0e6 100644 --- a/ch5/os/mm/address/struct.PhysPageNum.html +++ b/ch5/os/mm/address/struct.PhysPageNum.html @@ -1,22 +1,21 @@ -PhysPageNum in os::mm::address - Rust -

Struct os::mm::address::PhysPageNum

source ·
pub struct PhysPageNum(pub usize);
Expand description

physical page number

+PhysPageNum in os::mm::address - Rust

Struct os::mm::address::PhysPageNum

source ·
pub struct PhysPageNum(pub usize);
Expand description

physical page number

Tuple Fields§

§0: usize

Implementations§

source§

impl PhysPageNum

source

pub fn get_pte_array(&self) -> &'static mut [PageTableEntry]

Get PageTableEntry on PhysPageNum

-
source

pub fn get_bytes_array(&self) -> &'static mut [u8]

source

pub fn get_mut<T>(&self) -> &'static mut T

Trait Implementations§

source§

impl Clone for PhysPageNum

source§

fn clone(&self) -> PhysPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for usize

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysPageNum

source§

fn cmp(&self, other: &PhysPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +

source

pub fn get_bytes_array(&self) -> &'static mut [u8]

source

pub fn get_mut<T>(&self) -> &'static mut T

Trait Implementations§

source§

impl Clone for PhysPageNum

source§

fn clone(&self) -> PhysPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for usize

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysPageNum

source§

fn cmp(&self, other: &PhysPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PhysPageNum

source§

fn eq(&self, other: &PhysPageNum) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysPageNum

source§

fn partial_cmp(&self, other: &PhysPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for PhysPageNum

source§

impl Eq for PhysPageNum

source§

impl StructuralEq for PhysPageNum

source§

impl StructuralPartialEq for PhysPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysPageNum

source§

fn partial_cmp(&self, other: &PhysPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for PhysPageNum

source§

impl Eq for PhysPageNum

source§

impl StructuralPartialEq for PhysPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/address/struct.SimpleRange.html b/ch5/os/mm/address/struct.SimpleRange.html index 08d1bcaa..d3425b01 100644 --- a/ch5/os/mm/address/struct.SimpleRange.html +++ b/ch5/os/mm/address/struct.SimpleRange.html @@ -1,5 +1,4 @@ -SimpleRange in os::mm::address - Rust -

Struct os::mm::address::SimpleRange

source ·
pub struct SimpleRange<T>
where +SimpleRange in os::mm::address - Rust

Struct os::mm::address::SimpleRange

source ·
pub struct SimpleRange<T>{
     l: T,
     r: T,
@@ -8,7 +7,8 @@
     T: StepByOne + Copy + PartialEq + PartialOrd + Debug,
source

pub fn new(start: T, end: T) -> Self

source

pub fn get_start(&self) -> T

source

pub fn get_end(&self) -> T

Trait Implementations§

source§

impl<T> Clone for SimpleRange<T>

source§

fn clone(&self) -> SimpleRange<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T> IntoIterator for SimpleRange<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = SimpleRangeIterator<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T> Copy for SimpleRange<T>

Auto Trait Implementations§

Auto Trait Implementations§

§

impl<T> Freeze for SimpleRange<T>
where + T: Freeze,

§

impl<T> RefUnwindSafe for SimpleRange<T>
where T: RefUnwindSafe,

§

impl<T> Send for SimpleRange<T>
where T: Send,

§

impl<T> Sync for SimpleRange<T>
where T: Sync,

§

impl<T> Unpin for SimpleRange<T>
where @@ -16,12 +16,12 @@ T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/address/struct.SimpleRangeIterator.html b/ch5/os/mm/address/struct.SimpleRangeIterator.html index 700fe996..68ddf19b 100644 --- a/ch5/os/mm/address/struct.SimpleRangeIterator.html +++ b/ch5/os/mm/address/struct.SimpleRangeIterator.html @@ -1,88 +1,87 @@ -SimpleRangeIterator in os::mm::address - Rust -
pub struct SimpleRangeIterator<T>
where +SimpleRangeIterator in os::mm::address - Rust

Struct os::mm::address::SimpleRangeIterator

source ·
pub struct SimpleRangeIterator<T>{
     current: T,
     end: T,
 }
Expand description

iterator for the simple range structure

Fields§

§current: T§end: T

Implementations§

source§

impl<T> SimpleRangeIterator<T>

source

pub fn new(l: T, r: T) -> Self

Trait Implementations§

source§

impl<T> Iterator for SimpleRangeIterator<T>

§

type Item = T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( + T: StepByOne + Copy + PartialEq + PartialOrd + Debug,

§

type Item = T

The type of the elements being iterated over.
source§

fn next(&mut self) -> Option<Self::Item>

Advances the iterator and returns the next value. Read more
source§

fn next_chunk<const N: usize>( &mut self ) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usize
where - Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where - Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZeroUsize>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_next_chunk)
Advances the iterator and returns an array containing the next N values. Read more
1.0.0 · source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more
1.0.0 · source§

fn count(self) -> usize
where + Self: Sized,

Consumes the iterator, counting the number of iterations and returning it. Read more
1.0.0 · source§

fn last(self) -> Option<Self::Item>
where + Self: Sized,

Consumes the iterator, returning the last element. Read more
source§

fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by)
Advances the iterator by n elements. Read more
1.0.0 · source§

fn nth(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element of the iterator. Read more
1.28.0 · source§

fn step_by(self, step: usize) -> StepBy<Self>
where Self: Sized,

Creates an iterator starting at the same point, but stepping by -the given amount at each iteration. Read more
1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where +the given amount at each iteration. Read more

1.0.0 · source§

fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter>
where Self: Sized, - U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where + U: IntoIterator<Item = Self::Item>,

Takes two iterators and creates a new iterator over both in sequence. Read more
1.0.0 · source§

fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter>
where Self: Sized, - U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where + U: IntoIterator,

‘Zips up’ two iterators into a single iterator of pairs. Read more
source§

fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G>
where Self: Sized, G: FnMut() -> Self::Item,

🔬This is a nightly-only experimental API. (iter_intersperse)
Creates a new iterator which places an item generated by separator -between adjacent items of the original iterator. Read more
1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where +between adjacent items of the original iterator. Read more

1.0.0 · source§

fn map<B, F>(self, f: F) -> Map<Self, F>
where Self: Sized, F: FnMut(Self::Item) -> B,

Takes a closure and creates an iterator which calls that closure on each -element. Read more
1.21.0 · source§

fn for_each<F>(self, f: F)
where +element. Read more

1.21.0 · source§

fn for_each<F>(self, f: F)
where Self: Sized, - F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where + F: FnMut(Self::Item),

Calls a closure on each element of an iterator. Read more
1.0.0 · source§

fn filter<P>(self, predicate: P) -> Filter<Self, P>
where Self: Sized, P: FnMut(&Self::Item) -> bool,

Creates an iterator which uses a closure to determine if an element -should be yielded. Read more
1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where +should be yielded. Read more

1.0.0 · source§

fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F>
where Self: Sized, - F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where + F: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both filters and maps. Read more
1.0.0 · source§

fn enumerate(self) -> Enumerate<Self>
where Self: Sized,

Creates an iterator which gives the current iteration count as well as -the next value. Read more
1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where +the next value. Read more

1.0.0 · source§

fn peekable(self) -> Peekable<Self>
where Self: Sized,

Creates an iterator which can use the peek and peek_mut methods to look at the next element of the iterator without consuming it. See -their documentation for more information. Read more
1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where +their documentation for more information. Read more

1.0.0 · source§

fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P>
where Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where + P: FnMut(&Self::Item) -> bool,

Creates an iterator that skips elements based on a predicate. Read more
1.0.0 · source§

fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P>
where Self: Sized, - P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where + P: FnMut(&Self::Item) -> bool,

Creates an iterator that yields elements based on a predicate. Read more
1.57.0 · source§

fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P>
where Self: Sized, - P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where - Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where + P: FnMut(Self::Item) -> Option<B>,

Creates an iterator that both yields elements based on a predicate and maps. Read more
1.0.0 · source§

fn skip(self, n: usize) -> Skip<Self>
where + Self: Sized,

Creates an iterator that skips the first n elements. Read more
1.0.0 · source§

fn take(self, n: usize) -> Take<Self>
where Self: Sized,

Creates an iterator that yields the first n elements, or fewer -if the underlying iterator ends sooner. Read more
1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where +if the underlying iterator ends sooner. Read more

1.0.0 · source§

fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F>
where Self: Sized, F: FnMut(&mut St, Self::Item) -> Option<B>,

An iterator adapter which, like fold, holds internal state, but -unlike fold, produces a new iterator. Read more
1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where +unlike fold, produces a new iterator. Read more

1.0.0 · source§

fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F>
where Self: Sized, U: IntoIterator, - F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where + F: FnMut(Self::Item) -> U,

Creates an iterator that works like map, but flattens nested structure. Read more
source§

fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N>
where Self: Sized, F: FnMut(&[Self::Item; N]) -> R,

🔬This is a nightly-only experimental API. (iter_map_windows)
Calls the given function f for each contiguous window of size N over self and returns an iterator over the outputs of f. Like slice::windows(), -the windows during mapping overlap as well. Read more
1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where - Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where +the windows during mapping overlap as well. Read more

1.0.0 · source§

fn fuse(self) -> Fuse<Self>
where + Self: Sized,

Creates an iterator which ends after the first None. Read more
1.0.0 · source§

fn inspect<F>(self, f: F) -> Inspect<Self, F>
where Self: Sized, - F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where - Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where + F: FnMut(&Self::Item),

Does something with each element of an iterator, passing the value on. Read more
1.0.0 · source§

fn by_ref(&mut self) -> &mut Self
where + Self: Sized,

Borrows an iterator, rather than consuming it. Read more
1.0.0 · source§

fn collect<B>(self) -> B
where B: FromIterator<Self::Item>, - Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where + Self: Sized,

Transforms an iterator into a collection. Read more
source§

fn collect_into<E>(self, collection: &mut E) -> &mut E
where E: Extend<Self::Item>, - Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_collect_into)
Collects all the items from an iterator into a collection. Read more
1.0.0 · source§

fn partition<B, F>(self, f: F) -> (B, B)
where Self: Sized, B: Default + Extend<Self::Item>, - F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where + F: FnMut(&Self::Item) -> bool,

Consumes an iterator, creating two collections from it. Read more
source§

fn is_partitioned<P>(self, predicate: P) -> bool
where Self: Sized, P: FnMut(Self::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_is_partitioned)
Checks if the elements of this iterator are partitioned according to the given predicate, -such that all those that return true precede all those that return false. Read more
1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where +such that all those that return true precede all those that return false. Read more

1.27.0 · source§

fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,

An iterator method that applies a function as long as it returns -successfully, producing a single, final value. Read more
1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where +successfully, producing a single, final value. Read more

1.27.0 · source§

fn try_for_each<F, R>(&mut self, f: F) -> R
where Self: Sized, F: FnMut(Self::Item) -> R, R: Try<Output = ()>,

An iterator method that applies a fallible function to each item in the -iterator, stopping at the first error and returning that error. Read more
1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where +iterator, stopping at the first error and returning that error. Read more

1.0.0 · source§

fn fold<B, F>(self, init: B, f: F) -> B
where Self: Sized, F: FnMut(B, Self::Item) -> B,

Folds every element into an accumulator by applying an operation, -returning the final result. Read more
1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where +returning the final result. Read more

1.51.0 · source§

fn reduce<F>(self, f: F) -> Option<Self::Item>
where Self: Sized, F: FnMut(Self::Item, Self::Item) -> Self::Item,

Reduces the elements to a single one, by repeatedly applying a reducing -operation. Read more
source§

fn try_reduce<F, R>( +operation. Read more

source§

fn try_reduce<F, R>( &mut self, f: F ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where @@ -90,16 +89,16 @@ operation. FnMut(Self::Item, Self::Item) -> R, R: Try<Output = Self::Item>, <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (iterator_try_reduce)
Reduces the elements to a single one by repeatedly applying a reducing operation. If the -closure returns a failure, the failure is propagated back to the caller immediately. Read more
1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where +closure returns a failure, the failure is propagated back to the caller immediately. Read more

1.0.0 · source§

fn all<F>(&mut self, f: F) -> bool
where Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where + F: FnMut(Self::Item) -> bool,

Tests if every element of the iterator matches a predicate. Read more
1.0.0 · source§

fn any<F>(&mut self, f: F) -> bool
where Self: Sized, - F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where + F: FnMut(Self::Item) -> bool,

Tests if any element of the iterator matches a predicate. Read more
1.0.0 · source§

fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where Self: Sized, - P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where + P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator that satisfies a predicate. Read more
1.30.0 · source§

fn find_map<B, F>(&mut self, f: F) -> Option<B>
where Self: Sized, F: FnMut(Self::Item) -> Option<B>,

Applies function to the elements of iterator and returns -the first non-none result. Read more
source§

fn try_find<F, R>( +the first non-none result. Read more

source§

fn try_find<F, R>( &mut self, f: F ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where @@ -107,83 +106,84 @@ the first non-none result. FnMut(&Self::Item) -> R, R: Try<Output = bool>, <R as Try>::Residual: Residual<Option<Self::Item>>,

🔬This is a nightly-only experimental API. (try_find)
Applies function to the elements of iterator and returns -the first true result or the first error. Read more
1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where +the first true result or the first error. Read more

1.0.0 · source§

fn position<P>(&mut self, predicate: P) -> Option<usize>
where Self: Sized, - P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where + P: FnMut(Self::Item) -> bool,

Searches for an element in an iterator, returning its index. Read more
1.6.0 · source§

fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where B: Ord, Self: Sized, F: FnMut(&Self::Item) -> B,

Returns the element that gives the maximum value from the -specified function. Read more
1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where +specified function. Read more

1.15.0 · source§

fn max_by<F>(self, compare: F) -> Option<Self::Item>
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the maximum value with respect to the -specified comparison function. Read more
1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where +specified comparison function. Read more

1.6.0 · source§

fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where B: Ord, Self: Sized, F: FnMut(&Self::Item) -> B,

Returns the element that gives the minimum value from the -specified function. Read more
1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where +specified function. Read more

1.15.0 · source§

fn min_by<F>(self, compare: F) -> Option<Self::Item>
where Self: Sized, F: FnMut(&Self::Item, &Self::Item) -> Ordering,

Returns the element that gives the minimum value with respect to the -specified comparison function. Read more
1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where +specified comparison function. Read more

1.0.0 · source§

fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where FromA: Default + Extend<A>, FromB: Default + Extend<B>, - Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where + Self: Sized + Iterator<Item = (A, B)>,

Converts an iterator of pairs into a pair of containers. Read more
1.36.0 · source§

fn copied<'a, T>(self) -> Copied<Self>
where T: 'a + Copy, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which copies all of its elements. Read more
1.0.0 · source§

fn cloned<'a, T>(self) -> Cloned<Self>
where T: 'a + Clone, - Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where - Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where + Self: Sized + Iterator<Item = &'a T>,

Creates an iterator which clones all of its elements. Read more
source§

fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N>
where + Self: Sized,

🔬This is a nightly-only experimental API. (iter_array_chunks)
Returns an iterator over N elements of the iterator at a time. Read more
1.11.0 · source§

fn sum<S>(self) -> S
where Self: Sized, - S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where + S: Sum<Self::Item>,

Sums the elements of an iterator. Read more
1.11.0 · source§

fn product<P>(self) -> P
where Self: Sized, - P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where + P: Product<Self::Item>,

Iterates over the entire iterator, multiplying all the elements Read more
source§

fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where +of another with respect to the specified comparison function. Read more

1.5.0 · source§

fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,

Lexicographically compares the PartialOrd elements of this Iterator with those of another. The comparison works like short-circuit evaluation, returning a result without comparing the remaining elements. -As soon as an order can be determined, the evaluation stops and a result is returned. Read more
source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where +As soon as an order can be determined, the evaluation stops and a result is returned. Read more

source§

fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (iter_order_by)
Lexicographically compares the elements of this Iterator with those -of another with respect to the specified comparison function. Read more
1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where +of another with respect to the specified comparison function. Read more

1.5.0 · source§

fn eq<I>(self, other: I) -> bool
where I: IntoIterator, Self::Item: PartialEq<<I as IntoIterator>::Item>, Self: Sized,

Determines if the elements of this Iterator are equal to those of -another. Read more
source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where +another. Read more

source§

fn eq_by<I, F>(self, other: I, eq: F) -> bool
where Self: Sized, I: IntoIterator, F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool,

🔬This is a nightly-only experimental API. (iter_order_by)
Determines if the elements of this Iterator are equal to those of -another with respect to the specified equality function. Read more
1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where +another with respect to the specified equality function. Read more

1.5.0 · source§

fn ne<I>(self, other: I) -> bool
where I: IntoIterator, Self::Item: PartialEq<<I as IntoIterator>::Item>, Self: Sized,

Determines if the elements of this Iterator are not equal to those of -another. Read more
1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where +another. Read more

1.5.0 · source§

fn lt<I>(self, other: I) -> bool
where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,

Determines if the elements of this Iterator are lexicographically -less than those of another. Read more
1.5.0 · source§

fn le<I>(self, other: I) -> bool
where +less than those of another. Read more

1.5.0 · source§

fn le<I>(self, other: I) -> bool
where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,

Determines if the elements of this Iterator are lexicographically -less or equal to those of another. Read more
1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where +less or equal to those of another. Read more

1.5.0 · source§

fn gt<I>(self, other: I) -> bool
where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than those of another. Read more
1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where +greater than those of another. Read more

1.5.0 · source§

fn ge<I>(self, other: I) -> bool
where I: IntoIterator, Self::Item: PartialOrd<<I as IntoIterator>::Item>, Self: Sized,

Determines if the elements of this Iterator are lexicographically -greater than or equal to those of another. Read more
source§

fn is_sorted_by<F>(self, compare: F) -> bool
where +greater than or equal to those of another. Read more

source§

fn is_sorted_by<F>(self, compare: F) -> bool
where Self: Sized, - F: FnMut(&Self::Item, &Self::Item) -> Option<Ordering>,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where + F: FnMut(&Self::Item, &Self::Item) -> bool,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given comparator function. Read more
source§

fn is_sorted_by_key<F, K>(self, f: F) -> bool
where Self: Sized, F: FnMut(Self::Item) -> K, K: PartialOrd,

🔬This is a nightly-only experimental API. (is_sorted)
Checks if the elements of this iterator are sorted using the given key extraction -function. Read more

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for SimpleRangeIterator<T>
where +function. Read more

Auto Trait Implementations§

§

impl<T> Freeze for SimpleRangeIterator<T>
where + T: Freeze,

§

impl<T> RefUnwindSafe for SimpleRangeIterator<T>
where T: RefUnwindSafe,

§

impl<T> Send for SimpleRangeIterator<T>
where T: Send,

§

impl<T> Sync for SimpleRangeIterator<T>
where T: Sync,

§

impl<T> Unpin for SimpleRangeIterator<T>
where @@ -191,12 +191,12 @@ function. UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<I> IntoIterator for I
where - I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<I> IntoIterator for I
where + I: Iterator,

§

type Item = <I as Iterator>::Item

The type of the elements being iterated over.
§

type IntoIter = I

Which kind of iterator are we turning this into?
const: unstable · source§

fn into_iter(self) -> I

Creates an iterator from a value. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/address/struct.VirtAddr.html b/ch5/os/mm/address/struct.VirtAddr.html index b051e163..2267b3f5 100644 --- a/ch5/os/mm/address/struct.VirtAddr.html +++ b/ch5/os/mm/address/struct.VirtAddr.html @@ -1,26 +1,25 @@ -VirtAddr in os::mm::address - Rust -

Struct os::mm::address::VirtAddr

source ·
pub struct VirtAddr(pub usize);
Expand description

virtual address

+VirtAddr in os::mm::address - Rust

Struct os::mm::address::VirtAddr

source ·
pub struct VirtAddr(pub usize);
Expand description

virtual address

Tuple Fields§

§0: usize

Implementations§

source§

impl VirtAddr

source

pub fn floor(&self) -> VirtPageNum

VirtAddr->VirtPageNum

source

pub fn ceil(&self) -> VirtPageNum

VirtAddr->VirtPageNum

source

pub fn page_offset(&self) -> usize

Get page offset

source

pub fn aligned(&self) -> bool

Check page aligned

Trait Implementations§

source§

impl Clone for VirtAddr

source§

fn clone(&self) -> VirtAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtAddr

Debugging

-
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtAddr> for usize

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtAddr

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtAddr

source§

fn cmp(&self, other: &VirtAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtAddr> for usize

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtAddr

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtAddr

source§

fn cmp(&self, other: &VirtAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for VirtAddr

source§

fn eq(&self, other: &VirtAddr) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtAddr

source§

fn partial_cmp(&self, other: &VirtAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for VirtAddr

source§

impl Eq for VirtAddr

source§

impl StructuralEq for VirtAddr

source§

impl StructuralPartialEq for VirtAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtAddr

source§

fn partial_cmp(&self, other: &VirtAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for VirtAddr

source§

impl Eq for VirtAddr

source§

impl StructuralPartialEq for VirtAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/address/struct.VirtPageNum.html b/ch5/os/mm/address/struct.VirtPageNum.html index 05731bd4..79ccae46 100644 --- a/ch5/os/mm/address/struct.VirtPageNum.html +++ b/ch5/os/mm/address/struct.VirtPageNum.html @@ -1,22 +1,21 @@ -VirtPageNum in os::mm::address - Rust -

Struct os::mm::address::VirtPageNum

source ·
pub struct VirtPageNum(pub usize);
Expand description

virtual page number

+VirtPageNum in os::mm::address - Rust

Struct os::mm::address::VirtPageNum

source ·
pub struct VirtPageNum(pub usize);
Expand description

virtual page number

Tuple Fields§

§0: usize

Implementations§

source§

impl VirtPageNum

source

pub fn indexes(&self) -> [usize; 3]

Return VPN 3 level index

-

Trait Implementations§

source§

impl Clone for VirtPageNum

source§

fn clone(&self) -> VirtPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for usize

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtPageNum

source§

fn cmp(&self, other: &VirtPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +

Trait Implementations§

source§

impl Clone for VirtPageNum

source§

fn clone(&self) -> VirtPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for usize

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtPageNum

source§

fn cmp(&self, other: &VirtPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for VirtPageNum

source§

fn eq(&self, other: &VirtPageNum) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtPageNum

source§

fn partial_cmp(&self, other: &VirtPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl StepByOne for VirtPageNum

source§

fn step(&mut self)

source§

impl Copy for VirtPageNum

source§

impl Eq for VirtPageNum

source§

impl StructuralEq for VirtPageNum

source§

impl StructuralPartialEq for VirtPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtPageNum

source§

fn partial_cmp(&self, other: &VirtPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl StepByOne for VirtPageNum

source§

fn step(&mut self)

source§

impl Copy for VirtPageNum

source§

impl Eq for VirtPageNum

source§

impl StructuralPartialEq for VirtPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/address/trait.StepByOne.html b/ch5/os/mm/address/trait.StepByOne.html index 132454c7..52ea0d18 100644 --- a/ch5/os/mm/address/trait.StepByOne.html +++ b/ch5/os/mm/address/trait.StepByOne.html @@ -1,5 +1,4 @@ -StepByOne in os::mm::address - Rust -

Trait os::mm::address::StepByOne

source ·
pub trait StepByOne {
+StepByOne in os::mm::address - Rust

Trait os::mm::address::StepByOne

source ·
pub trait StepByOne {
     // Required method
     fn step(&mut self);
 }

Required Methods§

source

fn step(&mut self)

Implementors§

\ No newline at end of file diff --git a/ch5/os/mm/address/type.VPNRange.html b/ch5/os/mm/address/type.VPNRange.html index c6cc6774..432c1220 100644 --- a/ch5/os/mm/address/type.VPNRange.html +++ b/ch5/os/mm/address/type.VPNRange.html @@ -1,5 +1,4 @@ -VPNRange in os::mm::address - Rust -

Type Alias os::mm::address::VPNRange

source ·
pub type VPNRange = SimpleRange<VirtPageNum>;
Expand description

a simple range structure for virtual page number

+VPNRange in os::mm::address - Rust

Type Alias os::mm::address::VPNRange

source ·
pub type VPNRange = SimpleRange<VirtPageNum>;
Expand description

a simple range structure for virtual page number

Aliased Type§

struct VPNRange {
     l: VirtPageNum,
     r: VirtPageNum,
diff --git a/ch5/os/mm/fn.frame_alloc.html b/ch5/os/mm/fn.frame_alloc.html
index 13e16e14..d4432652 100644
--- a/ch5/os/mm/fn.frame_alloc.html
+++ b/ch5/os/mm/fn.frame_alloc.html
@@ -1,3 +1,2 @@
-frame_alloc in os::mm - Rust
-    

Function os::mm::frame_alloc

source ·
pub fn frame_alloc() -> Option<FrameTracker>
Expand description

allocate a frame

+frame_alloc in os::mm - Rust

Function os::mm::frame_alloc

source ·
pub fn frame_alloc() -> Option<FrameTracker>
Expand description

allocate a frame

\ No newline at end of file diff --git a/ch5/os/mm/fn.init.html b/ch5/os/mm/fn.init.html index fcd33013..20bcb8ce 100644 --- a/ch5/os/mm/fn.init.html +++ b/ch5/os/mm/fn.init.html @@ -1,3 +1,2 @@ -init in os::mm - Rust -

Function os::mm::init

source ·
pub fn init()
Expand description

initiate heap allocator, frame allocator and kernel space

+init in os::mm - Rust

Function os::mm::init

source ·
pub fn init()
Expand description

initiate heap allocator, frame allocator and kernel space

\ No newline at end of file diff --git a/ch5/os/mm/fn.remap_test.html b/ch5/os/mm/fn.remap_test.html index c02542f4..29c2199f 100644 --- a/ch5/os/mm/fn.remap_test.html +++ b/ch5/os/mm/fn.remap_test.html @@ -1,3 +1,2 @@ -remap_test in os::mm - Rust -

Function os::mm::remap_test

source ·
pub fn remap_test()
Expand description

Check PageTable running correctly

+remap_test in os::mm - Rust

Function os::mm::remap_test

source ·
pub fn remap_test()
Expand description

Check PageTable running correctly

\ No newline at end of file diff --git a/ch5/os/mm/fn.translated_byte_buffer.html b/ch5/os/mm/fn.translated_byte_buffer.html index 9a7677ba..3d38cc11 100644 --- a/ch5/os/mm/fn.translated_byte_buffer.html +++ b/ch5/os/mm/fn.translated_byte_buffer.html @@ -1,5 +1,4 @@ -translated_byte_buffer in os::mm - Rust -

Function os::mm::translated_byte_buffer

source ·
pub fn translated_byte_buffer(
+translated_byte_buffer in os::mm - Rust

Function os::mm::translated_byte_buffer

source ·
pub fn translated_byte_buffer(
     token: usize,
     ptr: *const u8,
     len: usize
diff --git a/ch5/os/mm/fn.translated_refmut.html b/ch5/os/mm/fn.translated_refmut.html
index dece410c..f331bed0 100644
--- a/ch5/os/mm/fn.translated_refmut.html
+++ b/ch5/os/mm/fn.translated_refmut.html
@@ -1,3 +1,2 @@
-translated_refmut in os::mm - Rust
-    

Function os::mm::translated_refmut

source ·
pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T
Expand description

translate a generic through page table and return a mutable reference

+translated_refmut in os::mm - Rust

Function os::mm::translated_refmut

source ·
pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T
Expand description

translate a generic through page table and return a mutable reference

\ No newline at end of file diff --git a/ch5/os/mm/fn.translated_str.html b/ch5/os/mm/fn.translated_str.html index 53bb4bdb..46888e34 100644 --- a/ch5/os/mm/fn.translated_str.html +++ b/ch5/os/mm/fn.translated_str.html @@ -1,3 +1,2 @@ -translated_str in os::mm - Rust -

Function os::mm::translated_str

source ·
pub fn translated_str(token: usize, ptr: *const u8) -> String
Expand description

translate a pointer to a mutable u8 Vec end with \0 through page table to a String

+translated_str in os::mm - Rust

Function os::mm::translated_str

source ·
pub fn translated_str(token: usize, ptr: *const u8) -> String
Expand description

translate a pointer to a mutable u8 Vec end with \0 through page table to a String

\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/fn.frame_alloc.html b/ch5/os/mm/frame_allocator/fn.frame_alloc.html index 4c2c2a46..03c087b6 100644 --- a/ch5/os/mm/frame_allocator/fn.frame_alloc.html +++ b/ch5/os/mm/frame_allocator/fn.frame_alloc.html @@ -1,3 +1,2 @@ -frame_alloc in os::mm::frame_allocator - Rust -

Function os::mm::frame_allocator::frame_alloc

source ·
pub fn frame_alloc() -> Option<FrameTracker>
Expand description

allocate a frame

+frame_alloc in os::mm::frame_allocator - Rust

Function os::mm::frame_allocator::frame_alloc

source ·
pub fn frame_alloc() -> Option<FrameTracker>
Expand description

allocate a frame

\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/fn.frame_allocator_test.html b/ch5/os/mm/frame_allocator/fn.frame_allocator_test.html index 67a0b384..d57a60b7 100644 --- a/ch5/os/mm/frame_allocator/fn.frame_allocator_test.html +++ b/ch5/os/mm/frame_allocator/fn.frame_allocator_test.html @@ -1,3 +1,2 @@ -frame_allocator_test in os::mm::frame_allocator - Rust -
pub fn frame_allocator_test()
Expand description

a simple test for frame allocator

+frame_allocator_test in os::mm::frame_allocator - Rust

Function os::mm::frame_allocator::frame_allocator_test

source ·
pub fn frame_allocator_test()
Expand description

a simple test for frame allocator

\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/fn.frame_dealloc.html b/ch5/os/mm/frame_allocator/fn.frame_dealloc.html index 2b0c9a02..a2d1e29a 100644 --- a/ch5/os/mm/frame_allocator/fn.frame_dealloc.html +++ b/ch5/os/mm/frame_allocator/fn.frame_dealloc.html @@ -1,3 +1,2 @@ -frame_dealloc in os::mm::frame_allocator - Rust -
fn frame_dealloc(ppn: PhysPageNum)
Expand description

deallocate a frame

+frame_dealloc in os::mm::frame_allocator - Rust

Function os::mm::frame_allocator::frame_dealloc

source ·
fn frame_dealloc(ppn: PhysPageNum)
Expand description

deallocate a frame

\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/fn.init_frame_allocator.html b/ch5/os/mm/frame_allocator/fn.init_frame_allocator.html index d3a02ab6..0af4acd8 100644 --- a/ch5/os/mm/frame_allocator/fn.init_frame_allocator.html +++ b/ch5/os/mm/frame_allocator/fn.init_frame_allocator.html @@ -1,3 +1,2 @@ -init_frame_allocator in os::mm::frame_allocator - Rust -
pub fn init_frame_allocator()
Expand description

initiate the frame allocator using ekernel and MEMORY_END

+init_frame_allocator in os::mm::frame_allocator - Rust

Function os::mm::frame_allocator::init_frame_allocator

source ·
pub fn init_frame_allocator()
Expand description

initiate the frame allocator using ekernel and MEMORY_END

\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/index.html b/ch5/os/mm/frame_allocator/index.html index 175ed8f5..5c061b30 100644 --- a/ch5/os/mm/frame_allocator/index.html +++ b/ch5/os/mm/frame_allocator/index.html @@ -1,4 +1,3 @@ -os::mm::frame_allocator - Rust -

Module os::mm::frame_allocator

source ·
Expand description

Implementation of FrameAllocator which +os::mm::frame_allocator - Rust

Module os::mm::frame_allocator

source ·
Expand description

Implementation of FrameAllocator which controls all the frames in the operating system.

-

Structs

Traits

Functions

Type Aliases

\ No newline at end of file +

Structs§

Traits§

Functions§

Type Aliases§

\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html b/ch5/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html index 60a3dbea..21f20b13 100644 --- a/ch5/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html +++ b/ch5/os/mm/frame_allocator/struct.FRAME_ALLOCATOR.html @@ -1,16 +1,15 @@ -FRAME_ALLOCATOR in os::mm::frame_allocator - Rust -
pub struct FRAME_ALLOCATOR {
+FRAME_ALLOCATOR in os::mm::frame_allocator - Rust

Struct os::mm::frame_allocator::FRAME_ALLOCATOR

source ·
pub struct FRAME_ALLOCATOR {
     __private_field: (),
 }
Expand description

frame allocator instance through lazy_static!

Fields§

§__private_field: ()

Methods from Deref<Target = UPSafeCell<StackFrameAllocator>>§

source

pub fn exclusive_access(&self) -> RefMut<'_, T>

Exclusive access inner data in UPSafeCell. Panic if the data has been borrowed.

-

Trait Implementations§

source§

impl Deref for FRAME_ALLOCATOR

§

type Target = UPSafeCell<StackFrameAllocator>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPSafeCell<StackFrameAllocator>

Dereferences the value.
source§

impl LazyStatic for FRAME_ALLOCATOR

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Deref for FRAME_ALLOCATOR

§

type Target = UPSafeCell<StackFrameAllocator>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPSafeCell<StackFrameAllocator>

Dereferences the value.
source§

impl LazyStatic for FRAME_ALLOCATOR

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/struct.FrameTracker.html b/ch5/os/mm/frame_allocator/struct.FrameTracker.html index 826a2be8..aec83f97 100644 --- a/ch5/os/mm/frame_allocator/struct.FrameTracker.html +++ b/ch5/os/mm/frame_allocator/struct.FrameTracker.html @@ -1,16 +1,15 @@ -FrameTracker in os::mm::frame_allocator - Rust -
pub struct FrameTracker {
+FrameTracker in os::mm::frame_allocator - Rust

Struct os::mm::frame_allocator::FrameTracker

source ·
pub struct FrameTracker {
     pub ppn: PhysPageNum,
 }
Expand description

manage a frame which has the same lifecycle as the tracker

Fields§

§ppn: PhysPageNum

Implementations§

source§

impl FrameTracker

source

pub fn new(ppn: PhysPageNum) -> Self

Create an empty FrameTracker

-

Trait Implementations§

source§

impl Debug for FrameTracker

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FrameTracker

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for FrameTracker

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FrameTracker

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/struct.StackFrameAllocator.html b/ch5/os/mm/frame_allocator/struct.StackFrameAllocator.html index 895e8538..c89f617d 100644 --- a/ch5/os/mm/frame_allocator/struct.StackFrameAllocator.html +++ b/ch5/os/mm/frame_allocator/struct.StackFrameAllocator.html @@ -1,17 +1,16 @@ -StackFrameAllocator in os::mm::frame_allocator - Rust -
pub struct StackFrameAllocator {
+StackFrameAllocator in os::mm::frame_allocator - Rust

Struct os::mm::frame_allocator::StackFrameAllocator

source ·
pub struct StackFrameAllocator {
     current: usize,
     end: usize,
     recycled: Vec<usize>,
 }
Expand description

an implementation for frame allocator

-

Fields§

§current: usize§end: usize§recycled: Vec<usize>

Implementations§

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Fields§

§current: usize§end: usize§recycled: Vec<usize>

Implementations§

Trait Implementations§

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/frame_allocator/trait.FrameAllocator.html b/ch5/os/mm/frame_allocator/trait.FrameAllocator.html index 38ddd2e5..e70bdde4 100644 --- a/ch5/os/mm/frame_allocator/trait.FrameAllocator.html +++ b/ch5/os/mm/frame_allocator/trait.FrameAllocator.html @@ -1,5 +1,4 @@ -FrameAllocator in os::mm::frame_allocator - Rust -
trait FrameAllocator {
+FrameAllocator in os::mm::frame_allocator - Rust

Trait os::mm::frame_allocator::FrameAllocator

source ·
trait FrameAllocator {
     // Required methods
     fn new() -> Self;
     fn alloc(&mut self) -> Option<PhysPageNum>;
diff --git a/ch5/os/mm/frame_allocator/type.FrameAllocatorImpl.html b/ch5/os/mm/frame_allocator/type.FrameAllocatorImpl.html
index 9b0ad15f..f0b3ce92 100644
--- a/ch5/os/mm/frame_allocator/type.FrameAllocatorImpl.html
+++ b/ch5/os/mm/frame_allocator/type.FrameAllocatorImpl.html
@@ -1,5 +1,4 @@
-FrameAllocatorImpl in os::mm::frame_allocator - Rust
-    
type FrameAllocatorImpl = StackFrameAllocator;

Aliased Type§

struct FrameAllocatorImpl {
+FrameAllocatorImpl in os::mm::frame_allocator - Rust

Type Alias os::mm::frame_allocator::FrameAllocatorImpl

source ·
type FrameAllocatorImpl = StackFrameAllocator;

Aliased Type§

struct FrameAllocatorImpl {
     current: usize,
     end: usize,
     recycled: Vec<usize>,
diff --git a/ch5/os/mm/heap_allocator/fn.handle_alloc_error.html b/ch5/os/mm/heap_allocator/fn.handle_alloc_error.html
index 33339de7..f6b5f63f 100644
--- a/ch5/os/mm/heap_allocator/fn.handle_alloc_error.html
+++ b/ch5/os/mm/heap_allocator/fn.handle_alloc_error.html
@@ -1,3 +1,2 @@
-handle_alloc_error in os::mm::heap_allocator - Rust
-    
pub fn handle_alloc_error(layout: Layout) -> !
Expand description

panic when heap allocation error occurs

+handle_alloc_error in os::mm::heap_allocator - Rust

Function os::mm::heap_allocator::handle_alloc_error

source ·
pub fn handle_alloc_error(layout: Layout) -> !
Expand description

panic when heap allocation error occurs

\ No newline at end of file diff --git a/ch5/os/mm/heap_allocator/fn.heap_test.html b/ch5/os/mm/heap_allocator/fn.heap_test.html index 1556bc9d..20764f2c 100644 --- a/ch5/os/mm/heap_allocator/fn.heap_test.html +++ b/ch5/os/mm/heap_allocator/fn.heap_test.html @@ -1,2 +1 @@ -heap_test in os::mm::heap_allocator - Rust -

Function os::mm::heap_allocator::heap_test

source ·
pub fn heap_test()
\ No newline at end of file +heap_test in os::mm::heap_allocator - Rust

Function os::mm::heap_allocator::heap_test

source ·
pub fn heap_test()
\ No newline at end of file diff --git a/ch5/os/mm/heap_allocator/fn.init_heap.html b/ch5/os/mm/heap_allocator/fn.init_heap.html index 679b1677..d50c0414 100644 --- a/ch5/os/mm/heap_allocator/fn.init_heap.html +++ b/ch5/os/mm/heap_allocator/fn.init_heap.html @@ -1,3 +1,2 @@ -init_heap in os::mm::heap_allocator - Rust -

Function os::mm::heap_allocator::init_heap

source ·
pub fn init_heap()
Expand description

initiate heap allocator

+init_heap in os::mm::heap_allocator - Rust

Function os::mm::heap_allocator::init_heap

source ·
pub fn init_heap()
Expand description

initiate heap allocator

\ No newline at end of file diff --git a/ch5/os/mm/heap_allocator/index.html b/ch5/os/mm/heap_allocator/index.html index 79d8f391..ef4c4caa 100644 --- a/ch5/os/mm/heap_allocator/index.html +++ b/ch5/os/mm/heap_allocator/index.html @@ -1,3 +1,2 @@ -os::mm::heap_allocator - Rust -

Module os::mm::heap_allocator

source ·
Expand description

The global allocator

-

Statics

Functions

\ No newline at end of file +os::mm::heap_allocator - Rust

Module os::mm::heap_allocator

source ·
Expand description

The global allocator

+

Statics§

Functions§

\ No newline at end of file diff --git a/ch5/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html b/ch5/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html index 3795da40..f7c0780b 100644 --- a/ch5/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html +++ b/ch5/os/mm/heap_allocator/static.HEAP_ALLOCATOR.html @@ -1,3 +1,2 @@ -HEAP_ALLOCATOR in os::mm::heap_allocator - Rust -
static HEAP_ALLOCATOR: LockedHeap
Expand description

heap allocator instance

+HEAP_ALLOCATOR in os::mm::heap_allocator - Rust

Static os::mm::heap_allocator::HEAP_ALLOCATOR

source ·
static HEAP_ALLOCATOR: LockedHeap
Expand description

heap allocator instance

\ No newline at end of file diff --git a/ch5/os/mm/heap_allocator/static.HEAP_SPACE.html b/ch5/os/mm/heap_allocator/static.HEAP_SPACE.html index 189c064c..9a28ec68 100644 --- a/ch5/os/mm/heap_allocator/static.HEAP_SPACE.html +++ b/ch5/os/mm/heap_allocator/static.HEAP_SPACE.html @@ -1,3 +1,2 @@ -HEAP_SPACE in os::mm::heap_allocator - Rust -
static mut HEAP_SPACE: [u8; 2097152]
Expand description

heap space ([u8; KERNEL_HEAP_SIZE])

+HEAP_SPACE in os::mm::heap_allocator - Rust

Static os::mm::heap_allocator::HEAP_SPACE

source ·
static mut HEAP_SPACE: [u8; 2097152]
Expand description

heap space ([u8; KERNEL_HEAP_SIZE])

\ No newline at end of file diff --git a/ch5/os/mm/index.html b/ch5/os/mm/index.html index f11174af..dbc2db44 100644 --- a/ch5/os/mm/index.html +++ b/ch5/os/mm/index.html @@ -1,8 +1,7 @@ -os::mm - Rust -

Module os::mm

source ·
Expand description

Memory management implementation

+os::mm - Rust

Module os::mm

source ·
Expand description

Memory management implementation

SV39 page-based virtual-memory architecture for RV64 systems, and everything about memory management, like frame allocator, page table, map area and memory set, is implemented here.

Every task or process has a memory_set to control its virtual memory.

-

Re-exports

  • pub use memory_set::KERNEL_SPACE;
  • pub use memory_set::KERNEL_SPACE;

Modules

Structs

Functions

  • allocate a frame
  • initiate heap allocator, frame allocator and kernel space
  • Check PageTable running correctly
  • translate a pointer to a mutable u8 Vec through page table
  • translate a generic through page table and return a mutable reference
  • translate a pointer to a mutable u8 Vec end with \0 through page table to a String
\ No newline at end of file +

Re-exports§

  • pub use memory_set::KERNEL_SPACE;
  • pub use memory_set::KERNEL_SPACE;

Modules§

Structs§

Functions§

  • allocate a frame
  • initiate heap allocator, frame allocator and kernel space
  • Check PageTable running correctly
  • translate a pointer to a mutable u8 Vec through page table
  • translate a generic through page table and return a mutable reference
  • translate a pointer to a mutable u8 Vec end with \0 through page table to a String
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/enum.MapType.html b/ch5/os/mm/memory_set/enum.MapType.html index a54e42ee..d1181472 100644 --- a/ch5/os/mm/memory_set/enum.MapType.html +++ b/ch5/os/mm/memory_set/enum.MapType.html @@ -1,19 +1,18 @@ -MapType in os::mm::memory_set - Rust -

Enum os::mm::memory_set::MapType

source ·
pub enum MapType {
+MapType in os::mm::memory_set - Rust

Enum os::mm::memory_set::MapType

source ·
pub enum MapType {
     Identical,
     Framed,
 }
Expand description

map type for memory set: identical or framed

Variants§

§

Identical

§

Framed

Trait Implementations§

source§

impl Clone for MapType

source§

fn clone(&self) -> MapType

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MapType

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for MapType

source§

fn eq(&self, other: &MapType) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for MapType

source§

impl StructuralPartialEq for MapType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for MapType

source§

impl StructuralPartialEq for MapType

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.ebss.html b/ch5/os/mm/memory_set/fn.ebss.html index d6e12023..24432331 100644 --- a/ch5/os/mm/memory_set/fn.ebss.html +++ b/ch5/os/mm/memory_set/fn.ebss.html @@ -1,2 +1 @@ -ebss in os::mm::memory_set - Rust -

Function os::mm::memory_set::ebss

source ·
unsafe extern "C" fn ebss()
\ No newline at end of file +ebss in os::mm::memory_set - Rust

Function os::mm::memory_set::ebss

source ·
unsafe extern "C" fn ebss()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.edata.html b/ch5/os/mm/memory_set/fn.edata.html index eefaa11a..cd7a1a2c 100644 --- a/ch5/os/mm/memory_set/fn.edata.html +++ b/ch5/os/mm/memory_set/fn.edata.html @@ -1,2 +1 @@ -edata in os::mm::memory_set - Rust -

Function os::mm::memory_set::edata

source ·
unsafe extern "C" fn edata()
\ No newline at end of file +edata in os::mm::memory_set - Rust

Function os::mm::memory_set::edata

source ·
unsafe extern "C" fn edata()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.ekernel.html b/ch5/os/mm/memory_set/fn.ekernel.html index 075f4cbf..34d86136 100644 --- a/ch5/os/mm/memory_set/fn.ekernel.html +++ b/ch5/os/mm/memory_set/fn.ekernel.html @@ -1,2 +1 @@ -ekernel in os::mm::memory_set - Rust -

Function os::mm::memory_set::ekernel

source ·
unsafe extern "C" fn ekernel()
\ No newline at end of file +ekernel in os::mm::memory_set - Rust

Function os::mm::memory_set::ekernel

source ·
unsafe extern "C" fn ekernel()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.erodata.html b/ch5/os/mm/memory_set/fn.erodata.html index 29c1d677..24e54795 100644 --- a/ch5/os/mm/memory_set/fn.erodata.html +++ b/ch5/os/mm/memory_set/fn.erodata.html @@ -1,2 +1 @@ -erodata in os::mm::memory_set - Rust -

Function os::mm::memory_set::erodata

source ·
unsafe extern "C" fn erodata()
\ No newline at end of file +erodata in os::mm::memory_set - Rust

Function os::mm::memory_set::erodata

source ·
unsafe extern "C" fn erodata()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.etext.html b/ch5/os/mm/memory_set/fn.etext.html index 6cdb55d7..9d47af78 100644 --- a/ch5/os/mm/memory_set/fn.etext.html +++ b/ch5/os/mm/memory_set/fn.etext.html @@ -1,2 +1 @@ -etext in os::mm::memory_set - Rust -

Function os::mm::memory_set::etext

source ·
unsafe extern "C" fn etext()
\ No newline at end of file +etext in os::mm::memory_set - Rust

Function os::mm::memory_set::etext

source ·
unsafe extern "C" fn etext()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.remap_test.html b/ch5/os/mm/memory_set/fn.remap_test.html index 0e833ae7..7ee52527 100644 --- a/ch5/os/mm/memory_set/fn.remap_test.html +++ b/ch5/os/mm/memory_set/fn.remap_test.html @@ -1,3 +1,2 @@ -remap_test in os::mm::memory_set - Rust -

Function os::mm::memory_set::remap_test

source ·
pub fn remap_test()
Expand description

Check PageTable running correctly

+remap_test in os::mm::memory_set - Rust

Function os::mm::memory_set::remap_test

source ·
pub fn remap_test()
Expand description

Check PageTable running correctly

\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.sbss_with_stack.html b/ch5/os/mm/memory_set/fn.sbss_with_stack.html index 18aaa198..d756da42 100644 --- a/ch5/os/mm/memory_set/fn.sbss_with_stack.html +++ b/ch5/os/mm/memory_set/fn.sbss_with_stack.html @@ -1,2 +1 @@ -sbss_with_stack in os::mm::memory_set - Rust -

Function os::mm::memory_set::sbss_with_stack

source ·
unsafe extern "C" fn sbss_with_stack()
\ No newline at end of file +sbss_with_stack in os::mm::memory_set - Rust

Function os::mm::memory_set::sbss_with_stack

source ·
unsafe extern "C" fn sbss_with_stack()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.sdata.html b/ch5/os/mm/memory_set/fn.sdata.html index e426cacb..3055c6ae 100644 --- a/ch5/os/mm/memory_set/fn.sdata.html +++ b/ch5/os/mm/memory_set/fn.sdata.html @@ -1,2 +1 @@ -sdata in os::mm::memory_set - Rust -

Function os::mm::memory_set::sdata

source ·
unsafe extern "C" fn sdata()
\ No newline at end of file +sdata in os::mm::memory_set - Rust

Function os::mm::memory_set::sdata

source ·
unsafe extern "C" fn sdata()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.srodata.html b/ch5/os/mm/memory_set/fn.srodata.html index 333e5380..9e434cad 100644 --- a/ch5/os/mm/memory_set/fn.srodata.html +++ b/ch5/os/mm/memory_set/fn.srodata.html @@ -1,2 +1 @@ -srodata in os::mm::memory_set - Rust -

Function os::mm::memory_set::srodata

source ·
unsafe extern "C" fn srodata()
\ No newline at end of file +srodata in os::mm::memory_set - Rust

Function os::mm::memory_set::srodata

source ·
unsafe extern "C" fn srodata()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.stext.html b/ch5/os/mm/memory_set/fn.stext.html index 53d98582..c94f00a6 100644 --- a/ch5/os/mm/memory_set/fn.stext.html +++ b/ch5/os/mm/memory_set/fn.stext.html @@ -1,2 +1 @@ -stext in os::mm::memory_set - Rust -

Function os::mm::memory_set::stext

source ·
unsafe extern "C" fn stext()
\ No newline at end of file +stext in os::mm::memory_set - Rust

Function os::mm::memory_set::stext

source ·
unsafe extern "C" fn stext()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/fn.strampoline.html b/ch5/os/mm/memory_set/fn.strampoline.html index 4264f985..6c6f1c02 100644 --- a/ch5/os/mm/memory_set/fn.strampoline.html +++ b/ch5/os/mm/memory_set/fn.strampoline.html @@ -1,2 +1 @@ -strampoline in os::mm::memory_set - Rust -

Function os::mm::memory_set::strampoline

source ·
unsafe extern "C" fn strampoline()
\ No newline at end of file +strampoline in os::mm::memory_set - Rust

Function os::mm::memory_set::strampoline

source ·
unsafe extern "C" fn strampoline()
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/index.html b/ch5/os/mm/memory_set/index.html index 83592208..e7682ccb 100644 --- a/ch5/os/mm/memory_set/index.html +++ b/ch5/os/mm/memory_set/index.html @@ -1,3 +1,2 @@ -os::mm::memory_set - Rust -

Module os::mm::memory_set

source ·
Expand description

Implementation of MapArea and MemorySet.

-

Structs

  • a memory set instance through lazy_static! managing kernel space
  • map area structure, controls a contiguous piece of virtual memory
  • map permission corresponding to that in pte: R W X U
  • memory set structure, controls virtual-memory space

Enums

  • map type for memory set: identical or framed

Functions

\ No newline at end of file +os::mm::memory_set - Rust

Module os::mm::memory_set

source ·
Expand description

Implementation of MapArea and MemorySet.

+

Structs§

  • a memory set instance through lazy_static! managing kernel space
  • map area structure, controls a contiguous piece of virtual memory
  • map permission corresponding to that in pte: R W X U
  • memory set structure, controls virtual-memory space

Enums§

  • map type for memory set: identical or framed

Functions§

\ No newline at end of file diff --git a/ch5/os/mm/memory_set/struct.KERNEL_SPACE.html b/ch5/os/mm/memory_set/struct.KERNEL_SPACE.html index 392db777..4cb24fed 100644 --- a/ch5/os/mm/memory_set/struct.KERNEL_SPACE.html +++ b/ch5/os/mm/memory_set/struct.KERNEL_SPACE.html @@ -1,15 +1,14 @@ -KERNEL_SPACE in os::mm::memory_set - Rust -

Struct os::mm::memory_set::KERNEL_SPACE

source ·
pub struct KERNEL_SPACE {
+KERNEL_SPACE in os::mm::memory_set - Rust

Struct os::mm::memory_set::KERNEL_SPACE

source ·
pub struct KERNEL_SPACE {
     __private_field: (),
 }
Expand description

a memory set instance through lazy_static! managing kernel space

-

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for KERNEL_SPACE

§

type Target = Arc<UPSafeCell<MemorySet>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<UPSafeCell<MemorySet>>

Dereferences the value.
source§

impl LazyStatic for KERNEL_SPACE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for KERNEL_SPACE

§

type Target = Arc<UPSafeCell<MemorySet>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<UPSafeCell<MemorySet>>

Dereferences the value.
source§

impl LazyStatic for KERNEL_SPACE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/struct.MapArea.html b/ch5/os/mm/memory_set/struct.MapArea.html index e1546cf8..60d64e9f 100644 --- a/ch5/os/mm/memory_set/struct.MapArea.html +++ b/ch5/os/mm/memory_set/struct.MapArea.html @@ -1,5 +1,4 @@ -MapArea in os::mm::memory_set - Rust -

Struct os::mm::memory_set::MapArea

source ·
pub struct MapArea {
+MapArea in os::mm::memory_set - Rust

Struct os::mm::memory_set::MapArea

source ·
pub struct MapArea {
     vpn_range: SimpleRange<VirtPageNum>,
     data_frames: BTreeMap<VirtPageNum, FrameTracker>,
     map_type: MapType,
@@ -12,14 +11,14 @@
     map_perm: MapPermission
 ) -> Self
source

pub fn from_another(another: &Self) -> Self

source

pub fn map_one(&mut self, page_table: &mut PageTable, vpn: VirtPageNum)

source

pub fn unmap_one(&mut self, page_table: &mut PageTable, vpn: VirtPageNum)

source

pub fn map(&mut self, page_table: &mut PageTable)

source

pub fn unmap(&mut self, page_table: &mut PageTable)

source

pub fn copy_data(&mut self, page_table: &mut PageTable, data: &[u8])

data: start-aligned but maybe with shorter length assume that all frames were cleared before

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/struct.MapPermission.html b/ch5/os/mm/memory_set/struct.MapPermission.html index 14e7e3ad..445eb05b 100644 --- a/ch5/os/mm/memory_set/struct.MapPermission.html +++ b/ch5/os/mm/memory_set/struct.MapPermission.html @@ -1,5 +1,4 @@ -MapPermission in os::mm::memory_set - Rust -

Struct os::mm::memory_set::MapPermission

source ·
pub struct MapPermission {
+MapPermission in os::mm::memory_set - Rust

Struct os::mm::memory_set::MapPermission

source ·
pub struct MapPermission {
     bits: u8,
 }
Expand description

map permission corresponding to that in pte: R W X U

Fields§

§bits: u8

Implementations§

source§

impl MapPermission

source

pub const R: Self = _

Readable

@@ -15,7 +14,7 @@ representation contains bits that do not correspond to a flag.

that do not correspond to flags.

source

pub const unsafe fn from_bits_unchecked(bits: u8) -> Self

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

-
Safety
+
§Safety

The caller of the bitflags! macro can chose to allow or disallow extra bits for their bitflags type.

The caller of from_bits_unchecked() has to ensure that @@ -65,32 +64,32 @@ between ops::Not), as in !flags.

Trait Implementations§

source§

impl Binary for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for MapPermission

source§

fn bitand(self, other: Self) -> Self

Returns the intersection between the two sets of flags.

-
§

type Output = MapPermission

The resulting type after applying the & operator.
source§

impl BitAndAssign for MapPermission

source§

fn bitand_assign(&mut self, other: Self)

Disables all flags disabled in the set.

+
§

type Output = MapPermission

The resulting type after applying the & operator.
source§

impl BitAndAssign for MapPermission

source§

fn bitand_assign(&mut self, other: Self)

Disables all flags disabled in the set.

source§

impl BitOr for MapPermission

source§

fn bitor(self, other: MapPermission) -> Self

Returns the union of the two sets of flags.

§

type Output = MapPermission

The resulting type after applying the | operator.
source§

impl BitOrAssign for MapPermission

source§

fn bitor_assign(&mut self, other: Self)

Adds the set of flags.

source§

impl BitXor for MapPermission

source§

fn bitxor(self, other: Self) -> Self

Returns the left flags, but with all the right flags toggled.

-
§

type Output = MapPermission

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MapPermission

source§

fn bitxor_assign(&mut self, other: Self)

Toggles the set of flags.

-
source§

impl Clone for MapPermission

source§

fn clone(&self) -> MapPermission

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MapPermission> for MapPermission

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl FromIterator<MapPermission> for MapPermission

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for MapPermission

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where +

§

type Output = MapPermission

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MapPermission

source§

fn bitxor_assign(&mut self, other: Self)

Toggles the set of flags.

+
source§

impl Clone for MapPermission

source§

fn clone(&self) -> MapPermission

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MapPermission> for MapPermission

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl FromIterator<MapPermission> for MapPermission

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for MapPermission

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for MapPermission

source§

fn not(self) -> Self

Returns the complement of this set of flags.

-
§

type Output = MapPermission

The resulting type after applying the ! operator.
source§

impl Octal for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for MapPermission

source§

fn cmp(&self, other: &MapPermission) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for MapPermission

source§

fn not(self) -> Self

Returns the complement of this set of flags.

+
§

type Output = MapPermission

The resulting type after applying the ! operator.
source§

impl Octal for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for MapPermission

source§

fn cmp(&self, other: &MapPermission) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MapPermission

source§

fn eq(&self, other: &MapPermission) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MapPermission

source§

fn partial_cmp(&self, other: &MapPermission) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MapPermission

source§

fn partial_cmp(&self, other: &MapPermission) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Sub for MapPermission

source§

fn sub(self, other: Self) -> Self

Returns the set difference of the two sets of flags.

-
§

type Output = MapPermission

The resulting type after applying the - operator.
source§

impl SubAssign for MapPermission

source§

fn sub_assign(&mut self, other: Self)

Disables all flags enabled in the set.

-
source§

impl UpperHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for MapPermission

source§

impl Eq for MapPermission

source§

impl StructuralEq for MapPermission

source§

impl StructuralPartialEq for MapPermission

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

§

type Output = MapPermission

The resulting type after applying the - operator.
source§

impl SubAssign for MapPermission

source§

fn sub_assign(&mut self, other: Self)

Disables all flags enabled in the set.

+
source§

impl UpperHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for MapPermission

source§

impl Eq for MapPermission

source§

impl StructuralPartialEq for MapPermission

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/memory_set/struct.MemorySet.html b/ch5/os/mm/memory_set/struct.MemorySet.html index a267aa75..b2ff0836 100644 --- a/ch5/os/mm/memory_set/struct.MemorySet.html +++ b/ch5/os/mm/memory_set/struct.MemorySet.html @@ -1,5 +1,4 @@ -MemorySet in os::mm::memory_set - Rust -

Struct os::mm::memory_set::MemorySet

source ·
pub struct MemorySet {
+MemorySet in os::mm::memory_set - Rust

Struct os::mm::memory_set::MemorySet

source ·
pub struct MemorySet {
     page_table: PageTable,
     areas: Vec<MapArea>,
 }
Expand description

memory set structure, controls virtual-memory space

@@ -20,14 +19,14 @@ also returns user_sp and entry point.

source

pub fn activate(&self)

Refresh TLB with sfence.vma

source

pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>

Translate throuth pagetable

source

pub fn recycle_data_pages(&mut self)

Remove all MapArea

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/page_table/fn.translated_byte_buffer.html b/ch5/os/mm/page_table/fn.translated_byte_buffer.html index 1feed5e1..509b8be1 100644 --- a/ch5/os/mm/page_table/fn.translated_byte_buffer.html +++ b/ch5/os/mm/page_table/fn.translated_byte_buffer.html @@ -1,5 +1,4 @@ -translated_byte_buffer in os::mm::page_table - Rust -
pub fn translated_byte_buffer(
+translated_byte_buffer in os::mm::page_table - Rust

Function os::mm::page_table::translated_byte_buffer

source ·
pub fn translated_byte_buffer(
     token: usize,
     ptr: *const u8,
     len: usize
diff --git a/ch5/os/mm/page_table/fn.translated_refmut.html b/ch5/os/mm/page_table/fn.translated_refmut.html
index 46fa7f20..f2fc029f 100644
--- a/ch5/os/mm/page_table/fn.translated_refmut.html
+++ b/ch5/os/mm/page_table/fn.translated_refmut.html
@@ -1,3 +1,2 @@
-translated_refmut in os::mm::page_table - Rust
-    
pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T
Expand description

translate a generic through page table and return a mutable reference

+translated_refmut in os::mm::page_table - Rust

Function os::mm::page_table::translated_refmut

source ·
pub fn translated_refmut<T>(token: usize, ptr: *mut T) -> &'static mut T
Expand description

translate a generic through page table and return a mutable reference

\ No newline at end of file diff --git a/ch5/os/mm/page_table/fn.translated_str.html b/ch5/os/mm/page_table/fn.translated_str.html index 28144ace..a7466b6e 100644 --- a/ch5/os/mm/page_table/fn.translated_str.html +++ b/ch5/os/mm/page_table/fn.translated_str.html @@ -1,3 +1,2 @@ -translated_str in os::mm::page_table - Rust -

Function os::mm::page_table::translated_str

source ·
pub fn translated_str(token: usize, ptr: *const u8) -> String
Expand description

translate a pointer to a mutable u8 Vec end with \0 through page table to a String

+translated_str in os::mm::page_table - Rust

Function os::mm::page_table::translated_str

source ·
pub fn translated_str(token: usize, ptr: *const u8) -> String
Expand description

translate a pointer to a mutable u8 Vec end with \0 through page table to a String

\ No newline at end of file diff --git a/ch5/os/mm/page_table/index.html b/ch5/os/mm/page_table/index.html index 9e104c12..9a1dc5e8 100644 --- a/ch5/os/mm/page_table/index.html +++ b/ch5/os/mm/page_table/index.html @@ -1,3 +1,2 @@ -os::mm::page_table - Rust -

Module os::mm::page_table

source ·
Expand description

Implementation of PageTableEntry and PageTable.

-

Structs

Functions

\ No newline at end of file +os::mm::page_table - Rust

Module os::mm::page_table

source ·
Expand description

Implementation of PageTableEntry and PageTable.

+

Structs§

Functions§

\ No newline at end of file diff --git a/ch5/os/mm/page_table/struct.PTEFlags.html b/ch5/os/mm/page_table/struct.PTEFlags.html index 69a36506..de72fd16 100644 --- a/ch5/os/mm/page_table/struct.PTEFlags.html +++ b/ch5/os/mm/page_table/struct.PTEFlags.html @@ -1,5 +1,4 @@ -PTEFlags in os::mm::page_table - Rust -

Struct os::mm::page_table::PTEFlags

source ·
pub struct PTEFlags {
+PTEFlags in os::mm::page_table - Rust

Struct os::mm::page_table::PTEFlags

source ·
pub struct PTEFlags {
     bits: u8,
 }

Fields§

§bits: u8

Implementations§

source§

impl PTEFlags

source

pub const V: Self = _

source

pub const R: Self = _

source

pub const W: Self = _

source

pub const X: Self = _

source

pub const U: Self = _

source

pub const G: Self = _

source

pub const A: Self = _

source

pub const D: Self = _

source

pub const fn empty() -> Self

Returns an empty set of flags.

source

pub const fn all() -> Self

Returns the set containing all flags.

@@ -10,7 +9,7 @@ representation contains bits that do not correspond to a flag.

that do not correspond to flags.

source

pub const unsafe fn from_bits_unchecked(bits: u8) -> Self

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

-
Safety
+
§Safety

The caller of the bitflags! macro can chose to allow or disallow extra bits for their bitflags type.

The caller of from_bits_unchecked() has to ensure that @@ -59,33 +58,33 @@ not set in self, but which are allowed for this type.

between Self::all() and self (e.g. Self::all() - self)

This is equivalent to using the ! operator (e.g. ops::Not), as in !flags.

-

Trait Implementations§

source§

impl Binary for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for PTEFlags

source§

fn bitand(self, other: Self) -> Self

Returns the intersection between the two sets of flags.

-
§

type Output = PTEFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for PTEFlags

source§

fn bitand_assign(&mut self, other: Self)

Disables all flags disabled in the set.

+

Trait Implementations§

source§

impl Binary for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for PTEFlags

source§

fn bitand(self, other: Self) -> Self

Returns the intersection between the two sets of flags.

+
§

type Output = PTEFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for PTEFlags

source§

fn bitand_assign(&mut self, other: Self)

Disables all flags disabled in the set.

source§

impl BitOr for PTEFlags

source§

fn bitor(self, other: PTEFlags) -> Self

Returns the union of the two sets of flags.

-
§

type Output = PTEFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for PTEFlags

source§

fn bitor_assign(&mut self, other: Self)

Adds the set of flags.

+
§

type Output = PTEFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for PTEFlags

source§

fn bitor_assign(&mut self, other: Self)

Adds the set of flags.

source§

impl BitXor for PTEFlags

source§

fn bitxor(self, other: Self) -> Self

Returns the left flags, but with all the right flags toggled.

-
§

type Output = PTEFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for PTEFlags

source§

fn bitxor_assign(&mut self, other: Self)

Toggles the set of flags.

-
source§

impl Clone for PTEFlags

source§

fn clone(&self) -> PTEFlags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<PTEFlags> for PTEFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl FromIterator<PTEFlags> for PTEFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for PTEFlags

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where +

§

type Output = PTEFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for PTEFlags

source§

fn bitxor_assign(&mut self, other: Self)

Toggles the set of flags.

+
source§

impl Clone for PTEFlags

source§

fn clone(&self) -> PTEFlags

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<PTEFlags> for PTEFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl FromIterator<PTEFlags> for PTEFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for PTEFlags

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for PTEFlags

source§

fn not(self) -> Self

Returns the complement of this set of flags.

-
§

type Output = PTEFlags

The resulting type after applying the ! operator.
source§

impl Octal for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for PTEFlags

source§

fn cmp(&self, other: &PTEFlags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +

§

type Output = PTEFlags

The resulting type after applying the ! operator.
source§

impl Octal for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for PTEFlags

source§

fn cmp(&self, other: &PTEFlags) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PTEFlags

source§

fn eq(&self, other: &PTEFlags) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PTEFlags

source§

fn partial_cmp(&self, other: &PTEFlags) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PTEFlags

source§

fn partial_cmp(&self, other: &PTEFlags) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Sub for PTEFlags

source§

fn sub(self, other: Self) -> Self

Returns the set difference of the two sets of flags.

-
§

type Output = PTEFlags

The resulting type after applying the - operator.
source§

impl SubAssign for PTEFlags

source§

fn sub_assign(&mut self, other: Self)

Disables all flags enabled in the set.

-
source§

impl UpperHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for PTEFlags

source§

impl Eq for PTEFlags

source§

impl StructuralEq for PTEFlags

source§

impl StructuralPartialEq for PTEFlags

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

§

type Output = PTEFlags

The resulting type after applying the - operator.
source§

impl SubAssign for PTEFlags

source§

fn sub_assign(&mut self, other: Self)

Disables all flags enabled in the set.

+
source§

impl UpperHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for PTEFlags

source§

impl Eq for PTEFlags

source§

impl StructuralPartialEq for PTEFlags

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/page_table/struct.PageTable.html b/ch5/os/mm/page_table/struct.PageTable.html index 303f22e0..991949d0 100644 --- a/ch5/os/mm/page_table/struct.PageTable.html +++ b/ch5/os/mm/page_table/struct.PageTable.html @@ -1,17 +1,16 @@ -PageTable in os::mm::page_table - Rust -

Struct os::mm::page_table::PageTable

source ·
pub struct PageTable {
+PageTable in os::mm::page_table - Rust

Struct os::mm::page_table::PageTable

source ·
pub struct PageTable {
     root_ppn: PhysPageNum,
     frames: Vec<FrameTracker>,
 }

Fields§

§root_ppn: PhysPageNum§frames: Vec<FrameTracker>

Implementations§

source§

impl PageTable

Assume that it won’t oom when creating/mapping.

source

pub fn new() -> Self

source

pub fn from_token(satp: usize) -> Self

Temporarily used to get arguments from user space.

-
source

fn find_pte_create(&mut self, vpn: VirtPageNum) -> Option<&mut PageTableEntry>

source

fn find_pte(&self, vpn: VirtPageNum) -> Option<&mut PageTableEntry>

source

pub fn map(&mut self, vpn: VirtPageNum, ppn: PhysPageNum, flags: PTEFlags)

source

pub fn unmap(&mut self, vpn: VirtPageNum)

source

pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>

source

pub fn translate_va(&self, va: VirtAddr) -> Option<PhysAddr>

source

pub fn token(&self) -> usize

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

source

fn find_pte_create(&mut self, vpn: VirtPageNum) -> Option<&mut PageTableEntry>

source

fn find_pte(&self, vpn: VirtPageNum) -> Option<&mut PageTableEntry>

source

pub fn map(&mut self, vpn: VirtPageNum, ppn: PhysPageNum, flags: PTEFlags)

source

pub fn unmap(&mut self, vpn: VirtPageNum)

source

pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>

source

pub fn translate_va(&self, va: VirtAddr) -> Option<PhysAddr>

source

pub fn token(&self) -> usize

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/page_table/struct.PageTableEntry.html b/ch5/os/mm/page_table/struct.PageTableEntry.html index 17d7bb6e..07f8c906 100644 --- a/ch5/os/mm/page_table/struct.PageTableEntry.html +++ b/ch5/os/mm/page_table/struct.PageTableEntry.html @@ -1,5 +1,4 @@ -PageTableEntry in os::mm::page_table - Rust -
#[repr(C)]
pub struct PageTableEntry { +PageTableEntry in os::mm::page_table - Rust

Struct os::mm::page_table::PageTableEntry

source ·
#[repr(C)]
pub struct PageTableEntry { pub bits: usize, }
Expand description

page table entry structure

Fields§

§bits: usize

PTE

@@ -11,15 +10,15 @@
source

pub fn readable(&self) -> bool

Check PTE readable

source

pub fn writable(&self) -> bool

Check PTE writable

source

pub fn executable(&self) -> bool

Check PTE executable

-

Trait Implementations§

source§

impl Clone for PageTableEntry

source§

fn clone(&self) -> PageTableEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for PageTableEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for PageTableEntry

source§

fn clone(&self) -> PageTableEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for PageTableEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.FrameTracker.html b/ch5/os/mm/struct.FrameTracker.html index 0000f6d3..c22028cf 100644 --- a/ch5/os/mm/struct.FrameTracker.html +++ b/ch5/os/mm/struct.FrameTracker.html @@ -1,16 +1,15 @@ -FrameTracker in os::mm - Rust -

Struct os::mm::FrameTracker

source ·
pub struct FrameTracker {
+FrameTracker in os::mm - Rust

Struct os::mm::FrameTracker

source ·
pub struct FrameTracker {
     pub ppn: PhysPageNum,
 }
Expand description

manage a frame which has the same lifecycle as the tracker

Fields§

§ppn: PhysPageNum

Implementations§

source§

impl FrameTracker

source

pub fn new(ppn: PhysPageNum) -> Self

Create an empty FrameTracker

-

Trait Implementations§

source§

impl Debug for FrameTracker

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FrameTracker

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Debug for FrameTracker

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for FrameTracker

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.KERNEL_SPACE.html b/ch5/os/mm/struct.KERNEL_SPACE.html index 21e45efd..5701b003 100644 --- a/ch5/os/mm/struct.KERNEL_SPACE.html +++ b/ch5/os/mm/struct.KERNEL_SPACE.html @@ -1,15 +1,14 @@ -KERNEL_SPACE in os::mm - Rust -

Struct os::mm::KERNEL_SPACE

source ·
pub struct KERNEL_SPACE {
+KERNEL_SPACE in os::mm - Rust

Struct os::mm::KERNEL_SPACE

source ·
pub struct KERNEL_SPACE {
     __private_field: (),
 }
Expand description

a memory set instance through lazy_static! managing kernel space

-

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for KERNEL_SPACE

§

type Target = Arc<UPSafeCell<MemorySet>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<UPSafeCell<MemorySet>>

Dereferences the value.
source§

impl LazyStatic for KERNEL_SPACE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for KERNEL_SPACE

§

type Target = Arc<UPSafeCell<MemorySet>>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<UPSafeCell<MemorySet>>

Dereferences the value.
source§

impl LazyStatic for KERNEL_SPACE

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.MapPermission.html b/ch5/os/mm/struct.MapPermission.html index a28a7a33..0784c3ee 100644 --- a/ch5/os/mm/struct.MapPermission.html +++ b/ch5/os/mm/struct.MapPermission.html @@ -1,5 +1,4 @@ -MapPermission in os::mm - Rust -

Struct os::mm::MapPermission

source ·
pub struct MapPermission {
+MapPermission in os::mm - Rust

Struct os::mm::MapPermission

source ·
pub struct MapPermission {
     bits: u8,
 }
Expand description

map permission corresponding to that in pte: R W X U

Fields§

§bits: u8

Implementations§

source§

impl MapPermission

source

pub const R: Self = _

Readable

@@ -15,7 +14,7 @@ representation contains bits that do not correspond to a flag.

that do not correspond to flags.

source

pub const unsafe fn from_bits_unchecked(bits: u8) -> Self

Convert from underlying bit representation, preserving all bits (even those not corresponding to a defined flag).

-
Safety
+
§Safety

The caller of the bitflags! macro can chose to allow or disallow extra bits for their bitflags type.

The caller of from_bits_unchecked() has to ensure that @@ -65,32 +64,32 @@ between ops::Not), as in !flags.

Trait Implementations§

source§

impl Binary for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl BitAnd for MapPermission

source§

fn bitand(self, other: Self) -> Self

Returns the intersection between the two sets of flags.

-
§

type Output = MapPermission

The resulting type after applying the & operator.
source§

impl BitAndAssign for MapPermission

source§

fn bitand_assign(&mut self, other: Self)

Disables all flags disabled in the set.

+
§

type Output = MapPermission

The resulting type after applying the & operator.
source§

impl BitAndAssign for MapPermission

source§

fn bitand_assign(&mut self, other: Self)

Disables all flags disabled in the set.

source§

impl BitOr for MapPermission

source§

fn bitor(self, other: MapPermission) -> Self

Returns the union of the two sets of flags.

§

type Output = MapPermission

The resulting type after applying the | operator.
source§

impl BitOrAssign for MapPermission

source§

fn bitor_assign(&mut self, other: Self)

Adds the set of flags.

source§

impl BitXor for MapPermission

source§

fn bitxor(self, other: Self) -> Self

Returns the left flags, but with all the right flags toggled.

-
§

type Output = MapPermission

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MapPermission

source§

fn bitxor_assign(&mut self, other: Self)

Toggles the set of flags.

-
source§

impl Clone for MapPermission

source§

fn clone(&self) -> MapPermission

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MapPermission> for MapPermission

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl FromIterator<MapPermission> for MapPermission

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for MapPermission

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where +

§

type Output = MapPermission

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MapPermission

source§

fn bitxor_assign(&mut self, other: Self)

Toggles the set of flags.

+
source§

impl Clone for MapPermission

source§

fn clone(&self) -> MapPermission

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MapPermission> for MapPermission

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

Extends a collection with the contents of an iterator. Read more
source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
source§

impl FromIterator<MapPermission> for MapPermission

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

Creates a value from an iterator. Read more
source§

impl Hash for MapPermission

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, - Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for MapPermission

source§

fn not(self) -> Self

Returns the complement of this set of flags.

-
§

type Output = MapPermission

The resulting type after applying the ! operator.
source§

impl Octal for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for MapPermission

source§

fn cmp(&self, other: &MapPermission) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where + Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl LowerHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Not for MapPermission

source§

fn not(self) -> Self

Returns the complement of this set of flags.

+
§

type Output = MapPermission

The resulting type after applying the ! operator.
source§

impl Octal for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Ord for MapPermission

source§

fn cmp(&self, other: &MapPermission) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for MapPermission

source§

fn eq(&self, other: &MapPermission) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MapPermission

source§

fn partial_cmp(&self, other: &MapPermission) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for MapPermission

source§

fn partial_cmp(&self, other: &MapPermission) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Sub for MapPermission

source§

fn sub(self, other: Self) -> Self

Returns the set difference of the two sets of flags.

-
§

type Output = MapPermission

The resulting type after applying the - operator.
source§

impl SubAssign for MapPermission

source§

fn sub_assign(&mut self, other: Self)

Disables all flags enabled in the set.

-
source§

impl UpperHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for MapPermission

source§

impl Eq for MapPermission

source§

impl StructuralEq for MapPermission

source§

impl StructuralPartialEq for MapPermission

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

§

type Output = MapPermission

The resulting type after applying the - operator.
source§

impl SubAssign for MapPermission

source§

fn sub_assign(&mut self, other: Self)

Disables all flags enabled in the set.

+
source§

impl UpperHex for MapPermission

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter.
source§

impl Copy for MapPermission

source§

impl Eq for MapPermission

source§

impl StructuralPartialEq for MapPermission

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.MemorySet.html b/ch5/os/mm/struct.MemorySet.html index 82832095..5da60431 100644 --- a/ch5/os/mm/struct.MemorySet.html +++ b/ch5/os/mm/struct.MemorySet.html @@ -1,5 +1,4 @@ -MemorySet in os::mm - Rust -

Struct os::mm::MemorySet

source ·
pub struct MemorySet {
+MemorySet in os::mm - Rust

Struct os::mm::MemorySet

source ·
pub struct MemorySet {
     page_table: PageTable,
     areas: Vec<MapArea>,
 }
Expand description

memory set structure, controls virtual-memory space

@@ -20,14 +19,14 @@ also returns user_sp and entry point.

source

pub fn activate(&self)

Refresh TLB with sfence.vma

source

pub fn translate(&self, vpn: VirtPageNum) -> Option<PageTableEntry>

Translate throuth pagetable

source

pub fn recycle_data_pages(&mut self)

Remove all MapArea

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.PageTableEntry.html b/ch5/os/mm/struct.PageTableEntry.html index ba924b06..6faad8a9 100644 --- a/ch5/os/mm/struct.PageTableEntry.html +++ b/ch5/os/mm/struct.PageTableEntry.html @@ -1,5 +1,4 @@ -PageTableEntry in os::mm - Rust -

Struct os::mm::PageTableEntry

source ·
#[repr(C)]
pub struct PageTableEntry { +PageTableEntry in os::mm - Rust

Struct os::mm::PageTableEntry

source ·
#[repr(C)]
pub struct PageTableEntry { pub bits: usize, }
Expand description

page table entry structure

Fields§

§bits: usize

PTE

@@ -11,15 +10,15 @@
source

pub fn readable(&self) -> bool

Check PTE readable

source

pub fn writable(&self) -> bool

Check PTE writable

source

pub fn executable(&self) -> bool

Check PTE executable

-

Trait Implementations§

source§

impl Clone for PageTableEntry

source§

fn clone(&self) -> PageTableEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for PageTableEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for PageTableEntry

source§

fn clone(&self) -> PageTableEntry

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Copy for PageTableEntry

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.PhysAddr.html b/ch5/os/mm/struct.PhysAddr.html index 1ecec220..2f827a90 100644 --- a/ch5/os/mm/struct.PhysAddr.html +++ b/ch5/os/mm/struct.PhysAddr.html @@ -1,29 +1,28 @@ -PhysAddr in os::mm - Rust -

Struct os::mm::PhysAddr

source ·
pub struct PhysAddr(pub usize);
Expand description

physical address

+PhysAddr in os::mm - Rust

Struct os::mm::PhysAddr

source ·
pub struct PhysAddr(pub usize);
Expand description

physical address

Tuple Fields§

§0: usize

Implementations§

source§

impl PhysAddr

source

pub fn floor(&self) -> PhysPageNum

PhysAddr->PhysPageNum

source

pub fn ceil(&self) -> PhysPageNum

PhysAddr->PhysPageNum

source

pub fn page_offset(&self) -> usize

Get page offset

source

pub fn aligned(&self) -> bool

Check page aligned

source§

impl PhysAddr

source

pub fn get_mut<T>(&self) -> &'static mut T

Get mutable reference to PhysAddr value

-

Trait Implementations§

source§

impl Clone for PhysAddr

source§

fn clone(&self) -> PhysAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysAddr> for usize

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysAddr

T: {PhysAddr, VirtAddr, PhysPageNum, VirtPageNum} +

Trait Implementations§

source§

impl Clone for PhysAddr

source§

fn clone(&self) -> PhysAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysAddr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysAddr> for usize

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysAddr

T: {PhysAddr, VirtAddr, PhysPageNum, VirtPageNum} T -> usize: T.0 usize -> T: usize.into()

-
source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysAddr

source§

fn cmp(&self, other: &PhysAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +
source§

fn from(v: usize) -> Self

Converts to this type from the input type.

source§

impl Ord for PhysAddr

source§

fn cmp(&self, other: &PhysAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PhysAddr

source§

fn eq(&self, other: &PhysAddr) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysAddr

source§

fn partial_cmp(&self, other: &PhysAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for PhysAddr

source§

impl Eq for PhysAddr

source§

impl StructuralEq for PhysAddr

source§

impl StructuralPartialEq for PhysAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysAddr

source§

fn partial_cmp(&self, other: &PhysAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for PhysAddr

source§

impl Eq for PhysAddr

source§

impl StructuralPartialEq for PhysAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.PhysPageNum.html b/ch5/os/mm/struct.PhysPageNum.html index f10eafc7..5a1f810a 100644 --- a/ch5/os/mm/struct.PhysPageNum.html +++ b/ch5/os/mm/struct.PhysPageNum.html @@ -1,22 +1,21 @@ -PhysPageNum in os::mm - Rust -

Struct os::mm::PhysPageNum

source ·
pub struct PhysPageNum(pub usize);
Expand description

physical page number

+PhysPageNum in os::mm - Rust

Struct os::mm::PhysPageNum

source ·
pub struct PhysPageNum(pub usize);
Expand description

physical page number

Tuple Fields§

§0: usize

Implementations§

source§

impl PhysPageNum

source

pub fn get_pte_array(&self) -> &'static mut [PageTableEntry]

Get PageTableEntry on PhysPageNum

-
source

pub fn get_bytes_array(&self) -> &'static mut [u8]

source

pub fn get_mut<T>(&self) -> &'static mut T

Trait Implementations§

source§

impl Clone for PhysPageNum

source§

fn clone(&self) -> PhysPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for usize

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysPageNum

source§

fn cmp(&self, other: &PhysPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +

source

pub fn get_bytes_array(&self) -> &'static mut [u8]

source

pub fn get_mut<T>(&self) -> &'static mut T

Trait Implementations§

source§

impl Clone for PhysPageNum

source§

fn clone(&self) -> PhysPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for PhysPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PhysAddr> for PhysPageNum

source§

fn from(v: PhysAddr) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for PhysAddr

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<PhysPageNum> for usize

source§

fn from(v: PhysPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for PhysPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for PhysPageNum

source§

fn cmp(&self, other: &PhysPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for PhysPageNum

source§

fn eq(&self, other: &PhysPageNum) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysPageNum

source§

fn partial_cmp(&self, other: &PhysPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for PhysPageNum

source§

impl Eq for PhysPageNum

source§

impl StructuralEq for PhysPageNum

source§

impl StructuralPartialEq for PhysPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for PhysPageNum

source§

fn partial_cmp(&self, other: &PhysPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for PhysPageNum

source§

impl Eq for PhysPageNum

source§

impl StructuralPartialEq for PhysPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.VirtAddr.html b/ch5/os/mm/struct.VirtAddr.html index eac81b7a..1cd59b2b 100644 --- a/ch5/os/mm/struct.VirtAddr.html +++ b/ch5/os/mm/struct.VirtAddr.html @@ -1,26 +1,25 @@ -VirtAddr in os::mm - Rust -

Struct os::mm::VirtAddr

source ·
pub struct VirtAddr(pub usize);
Expand description

virtual address

+VirtAddr in os::mm - Rust

Struct os::mm::VirtAddr

source ·
pub struct VirtAddr(pub usize);
Expand description

virtual address

Tuple Fields§

§0: usize

Implementations§

source§

impl VirtAddr

source

pub fn floor(&self) -> VirtPageNum

VirtAddr->VirtPageNum

source

pub fn ceil(&self) -> VirtPageNum

VirtAddr->VirtPageNum

source

pub fn page_offset(&self) -> usize

Get page offset

source

pub fn aligned(&self) -> bool

Check page aligned

Trait Implementations§

source§

impl Clone for VirtAddr

source§

fn clone(&self) -> VirtAddr

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtAddr

Debugging

-
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtAddr> for usize

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtAddr

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtAddr

source§

fn cmp(&self, other: &VirtAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +
source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtAddr> for usize

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtAddr

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtAddr

source§

fn cmp(&self, other: &VirtAddr) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for VirtAddr

source§

fn eq(&self, other: &VirtAddr) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtAddr

source§

fn partial_cmp(&self, other: &VirtAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl Copy for VirtAddr

source§

impl Eq for VirtAddr

source§

impl StructuralEq for VirtAddr

source§

impl StructuralPartialEq for VirtAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtAddr

source§

fn partial_cmp(&self, other: &VirtAddr) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl Copy for VirtAddr

source§

impl Eq for VirtAddr

source§

impl StructuralPartialEq for VirtAddr

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/mm/struct.VirtPageNum.html b/ch5/os/mm/struct.VirtPageNum.html index 20305cbc..ac69dd42 100644 --- a/ch5/os/mm/struct.VirtPageNum.html +++ b/ch5/os/mm/struct.VirtPageNum.html @@ -1,22 +1,21 @@ -VirtPageNum in os::mm - Rust -

Struct os::mm::VirtPageNum

source ·
pub struct VirtPageNum(pub usize);
Expand description

virtual page number

+VirtPageNum in os::mm - Rust

Struct os::mm::VirtPageNum

source ·
pub struct VirtPageNum(pub usize);
Expand description

virtual page number

Tuple Fields§

§0: usize

Implementations§

source§

impl VirtPageNum

source

pub fn indexes(&self) -> [usize; 3]

Return VPN 3 level index

-

Trait Implementations§

source§

impl Clone for VirtPageNum

source§

fn clone(&self) -> VirtPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for usize

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtPageNum

source§

fn cmp(&self, other: &VirtPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where - Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where +

Trait Implementations§

source§

impl Clone for VirtPageNum

source§

fn clone(&self) -> VirtPageNum

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for VirtPageNum

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<VirtAddr> for VirtPageNum

source§

fn from(v: VirtAddr) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for VirtAddr

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<VirtPageNum> for usize

source§

fn from(v: VirtPageNum) -> Self

Converts to this type from the input type.
source§

impl From<usize> for VirtPageNum

source§

fn from(v: usize) -> Self

Converts to this type from the input type.
source§

impl Ord for VirtPageNum

source§

fn cmp(&self, other: &VirtPageNum) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for VirtPageNum

source§

fn eq(&self, other: &VirtPageNum) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtPageNum

source§

fn partial_cmp(&self, other: &VirtPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= -operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
source§

impl StepByOne for VirtPageNum

source§

fn step(&mut self)

source§

impl Copy for VirtPageNum

source§

impl Eq for VirtPageNum

source§

impl StructuralEq for VirtPageNum

source§

impl StructuralPartialEq for VirtPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +by ==.

1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for VirtPageNum

source§

fn partial_cmp(&self, other: &VirtPageNum) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
source§

impl StepByOne for VirtPageNum

source§

fn step(&mut self)

source§

impl Copy for VirtPageNum

source§

impl Eq for VirtPageNum

source§

impl StructuralPartialEq for VirtPageNum

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/sbi/fn.console_getchar.html b/ch5/os/sbi/fn.console_getchar.html index eaf3ed47..3deb418c 100644 --- a/ch5/os/sbi/fn.console_getchar.html +++ b/ch5/os/sbi/fn.console_getchar.html @@ -1,3 +1,2 @@ -console_getchar in os::sbi - Rust -

Function os::sbi::console_getchar

source ·
pub fn console_getchar() -> usize
Expand description

use sbi call to getchar from console (qemu uart handler)

+console_getchar in os::sbi - Rust

Function os::sbi::console_getchar

source ·
pub fn console_getchar() -> usize
Expand description

use sbi call to getchar from console (qemu uart handler)

\ No newline at end of file diff --git a/ch5/os/sbi/fn.console_putchar.html b/ch5/os/sbi/fn.console_putchar.html index 211bc1be..2bfc0191 100644 --- a/ch5/os/sbi/fn.console_putchar.html +++ b/ch5/os/sbi/fn.console_putchar.html @@ -1,3 +1,2 @@ -console_putchar in os::sbi - Rust -

Function os::sbi::console_putchar

source ·
pub fn console_putchar(c: usize)
Expand description

use sbi call to putchar in console (qemu uart handler)

+console_putchar in os::sbi - Rust

Function os::sbi::console_putchar

source ·
pub fn console_putchar(c: usize)
Expand description

use sbi call to putchar in console (qemu uart handler)

\ No newline at end of file diff --git a/ch5/os/sbi/fn.set_timer.html b/ch5/os/sbi/fn.set_timer.html index e2ab22aa..88e62707 100644 --- a/ch5/os/sbi/fn.set_timer.html +++ b/ch5/os/sbi/fn.set_timer.html @@ -1,3 +1,2 @@ -set_timer in os::sbi - Rust -

Function os::sbi::set_timer

source ·
pub fn set_timer(timer: usize)
Expand description

use sbi call to set timer

+set_timer in os::sbi - Rust

Function os::sbi::set_timer

source ·
pub fn set_timer(timer: usize)
Expand description

use sbi call to set timer

\ No newline at end of file diff --git a/ch5/os/sbi/fn.shutdown.html b/ch5/os/sbi/fn.shutdown.html index c0577be2..a1efb63e 100644 --- a/ch5/os/sbi/fn.shutdown.html +++ b/ch5/os/sbi/fn.shutdown.html @@ -1,3 +1,2 @@ -shutdown in os::sbi - Rust -

Function os::sbi::shutdown

source ·
pub fn shutdown(failure: bool) -> !
Expand description

use sbi call to shutdown the kernel

+shutdown in os::sbi - Rust

Function os::sbi::shutdown

source ·
pub fn shutdown(failure: bool) -> !
Expand description

use sbi call to shutdown the kernel

\ No newline at end of file diff --git a/ch5/os/sbi/index.html b/ch5/os/sbi/index.html index 81de2fc1..b489a958 100644 --- a/ch5/os/sbi/index.html +++ b/ch5/os/sbi/index.html @@ -1,3 +1,2 @@ -os::sbi - Rust -

Module os::sbi

source ·
Expand description

SBI call wrappers

-

Functions

\ No newline at end of file +os::sbi - Rust

Module os::sbi

source ·
Expand description

SBI call wrappers

+

Functions§

\ No newline at end of file diff --git a/ch5/os/sync/index.html b/ch5/os/sync/index.html index 4711cd42..a70b7cc0 100644 --- a/ch5/os/sync/index.html +++ b/ch5/os/sync/index.html @@ -1,4 +1,3 @@ -os::sync - Rust -

Module os::sync

source ·
Expand description

Synchronization and interior mutability primitives

-

Modules

  • up 🔒
    Uniprocessor interior mutability primitives

Structs

Trait Implementations§

source§

impl<T> Sync for UPSafeCell<T>

Auto Trait Implementations§

§

impl<T> !Freeze for UPSafeCell<T>

§

impl<T> !RefUnwindSafe for UPSafeCell<T>

§

impl<T> Send for UPSafeCell<T>
where T: Send,

§

impl<T> Unpin for UPSafeCell<T>
where T: Unpin,

§

impl<T> UnwindSafe for UPSafeCell<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/sync/up/index.html b/ch5/os/sync/up/index.html index 5f3e3c96..89002d60 100644 --- a/ch5/os/sync/up/index.html +++ b/ch5/os/sync/up/index.html @@ -1,4 +1,3 @@ -os::sync::up - Rust -

Module os::sync::up

source ·
Expand description

Uniprocessor interior mutability primitives

-

Structs

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_EXEC.html b/ch5/os/syscall/constant.SYSCALL_EXEC.html index 56f66e1d..ef62840c 100644 --- a/ch5/os/syscall/constant.SYSCALL_EXEC.html +++ b/ch5/os/syscall/constant.SYSCALL_EXEC.html @@ -1,2 +1 @@ -SYSCALL_EXEC in os::syscall - Rust -

Constant os::syscall::SYSCALL_EXEC

source ·
const SYSCALL_EXEC: usize = 221;
\ No newline at end of file +SYSCALL_EXEC in os::syscall - Rust

Constant os::syscall::SYSCALL_EXEC

source ·
const SYSCALL_EXEC: usize = 221;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_EXIT.html b/ch5/os/syscall/constant.SYSCALL_EXIT.html index a7a34ee3..7c57f8f0 100644 --- a/ch5/os/syscall/constant.SYSCALL_EXIT.html +++ b/ch5/os/syscall/constant.SYSCALL_EXIT.html @@ -1,2 +1 @@ -SYSCALL_EXIT in os::syscall - Rust -

Constant os::syscall::SYSCALL_EXIT

source ·
const SYSCALL_EXIT: usize = 93;
\ No newline at end of file +SYSCALL_EXIT in os::syscall - Rust

Constant os::syscall::SYSCALL_EXIT

source ·
const SYSCALL_EXIT: usize = 93;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_FORK.html b/ch5/os/syscall/constant.SYSCALL_FORK.html index 0980b487..63cea872 100644 --- a/ch5/os/syscall/constant.SYSCALL_FORK.html +++ b/ch5/os/syscall/constant.SYSCALL_FORK.html @@ -1,2 +1 @@ -SYSCALL_FORK in os::syscall - Rust -

Constant os::syscall::SYSCALL_FORK

source ·
const SYSCALL_FORK: usize = 220;
\ No newline at end of file +SYSCALL_FORK in os::syscall - Rust

Constant os::syscall::SYSCALL_FORK

source ·
const SYSCALL_FORK: usize = 220;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_GETPID.html b/ch5/os/syscall/constant.SYSCALL_GETPID.html index e9e82e85..3f03c1b8 100644 --- a/ch5/os/syscall/constant.SYSCALL_GETPID.html +++ b/ch5/os/syscall/constant.SYSCALL_GETPID.html @@ -1,2 +1 @@ -SYSCALL_GETPID in os::syscall - Rust -

Constant os::syscall::SYSCALL_GETPID

source ·
const SYSCALL_GETPID: usize = 172;
\ No newline at end of file +SYSCALL_GETPID in os::syscall - Rust

Constant os::syscall::SYSCALL_GETPID

source ·
const SYSCALL_GETPID: usize = 172;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_GET_TIME.html b/ch5/os/syscall/constant.SYSCALL_GET_TIME.html index ad151730..42736ced 100644 --- a/ch5/os/syscall/constant.SYSCALL_GET_TIME.html +++ b/ch5/os/syscall/constant.SYSCALL_GET_TIME.html @@ -1,2 +1 @@ -SYSCALL_GET_TIME in os::syscall - Rust -

Constant os::syscall::SYSCALL_GET_TIME

source ·
const SYSCALL_GET_TIME: usize = 169;
\ No newline at end of file +SYSCALL_GET_TIME in os::syscall - Rust

Constant os::syscall::SYSCALL_GET_TIME

source ·
const SYSCALL_GET_TIME: usize = 169;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_READ.html b/ch5/os/syscall/constant.SYSCALL_READ.html index f02a66e7..68c73559 100644 --- a/ch5/os/syscall/constant.SYSCALL_READ.html +++ b/ch5/os/syscall/constant.SYSCALL_READ.html @@ -1,2 +1 @@ -SYSCALL_READ in os::syscall - Rust -

Constant os::syscall::SYSCALL_READ

source ·
const SYSCALL_READ: usize = 63;
\ No newline at end of file +SYSCALL_READ in os::syscall - Rust

Constant os::syscall::SYSCALL_READ

source ·
const SYSCALL_READ: usize = 63;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_WAITPID.html b/ch5/os/syscall/constant.SYSCALL_WAITPID.html index 9018dd3d..7d8993ba 100644 --- a/ch5/os/syscall/constant.SYSCALL_WAITPID.html +++ b/ch5/os/syscall/constant.SYSCALL_WAITPID.html @@ -1,2 +1 @@ -SYSCALL_WAITPID in os::syscall - Rust -

Constant os::syscall::SYSCALL_WAITPID

source ·
const SYSCALL_WAITPID: usize = 260;
\ No newline at end of file +SYSCALL_WAITPID in os::syscall - Rust

Constant os::syscall::SYSCALL_WAITPID

source ·
const SYSCALL_WAITPID: usize = 260;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_WRITE.html b/ch5/os/syscall/constant.SYSCALL_WRITE.html index 5a99ecae..066c19f0 100644 --- a/ch5/os/syscall/constant.SYSCALL_WRITE.html +++ b/ch5/os/syscall/constant.SYSCALL_WRITE.html @@ -1,2 +1 @@ -SYSCALL_WRITE in os::syscall - Rust -

Constant os::syscall::SYSCALL_WRITE

source ·
const SYSCALL_WRITE: usize = 64;
\ No newline at end of file +SYSCALL_WRITE in os::syscall - Rust

Constant os::syscall::SYSCALL_WRITE

source ·
const SYSCALL_WRITE: usize = 64;
\ No newline at end of file diff --git a/ch5/os/syscall/constant.SYSCALL_YIELD.html b/ch5/os/syscall/constant.SYSCALL_YIELD.html index c0b34fae..c19a4b73 100644 --- a/ch5/os/syscall/constant.SYSCALL_YIELD.html +++ b/ch5/os/syscall/constant.SYSCALL_YIELD.html @@ -1,2 +1 @@ -SYSCALL_YIELD in os::syscall - Rust -

Constant os::syscall::SYSCALL_YIELD

source ·
const SYSCALL_YIELD: usize = 124;
\ No newline at end of file +SYSCALL_YIELD in os::syscall - Rust

Constant os::syscall::SYSCALL_YIELD

source ·
const SYSCALL_YIELD: usize = 124;
\ No newline at end of file diff --git a/ch5/os/syscall/fn.syscall.html b/ch5/os/syscall/fn.syscall.html index ecbc1c99..56cfe32c 100644 --- a/ch5/os/syscall/fn.syscall.html +++ b/ch5/os/syscall/fn.syscall.html @@ -1,3 +1,2 @@ -syscall in os::syscall - Rust -

Function os::syscall::syscall

source ·
pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize
Expand description

handle syscall exception with syscall_id and other arguments

+syscall in os::syscall - Rust

Function os::syscall::syscall

source ·
pub fn syscall(syscall_id: usize, args: [usize; 3]) -> isize
Expand description

handle syscall exception with syscall_id and other arguments

\ No newline at end of file diff --git a/ch5/os/syscall/fs/constant.FD_STDIN.html b/ch5/os/syscall/fs/constant.FD_STDIN.html index 895a46d5..649e6f57 100644 --- a/ch5/os/syscall/fs/constant.FD_STDIN.html +++ b/ch5/os/syscall/fs/constant.FD_STDIN.html @@ -1,2 +1 @@ -FD_STDIN in os::syscall::fs - Rust -

Constant os::syscall::fs::FD_STDIN

source ·
const FD_STDIN: usize = 0;
\ No newline at end of file +FD_STDIN in os::syscall::fs - Rust

Constant os::syscall::fs::FD_STDIN

source ·
const FD_STDIN: usize = 0;
\ No newline at end of file diff --git a/ch5/os/syscall/fs/constant.FD_STDOUT.html b/ch5/os/syscall/fs/constant.FD_STDOUT.html index eaf136f1..f130f63e 100644 --- a/ch5/os/syscall/fs/constant.FD_STDOUT.html +++ b/ch5/os/syscall/fs/constant.FD_STDOUT.html @@ -1,2 +1 @@ -FD_STDOUT in os::syscall::fs - Rust -

Constant os::syscall::fs::FD_STDOUT

source ·
const FD_STDOUT: usize = 1;
\ No newline at end of file +FD_STDOUT in os::syscall::fs - Rust

Constant os::syscall::fs::FD_STDOUT

source ·
const FD_STDOUT: usize = 1;
\ No newline at end of file diff --git a/ch5/os/syscall/fs/fn.sys_read.html b/ch5/os/syscall/fs/fn.sys_read.html index 28966991..474ed20d 100644 --- a/ch5/os/syscall/fs/fn.sys_read.html +++ b/ch5/os/syscall/fs/fn.sys_read.html @@ -1,2 +1 @@ -sys_read in os::syscall::fs - Rust -

Function os::syscall::fs::sys_read

source ·
pub fn sys_read(fd: usize, buf: *const u8, len: usize) -> isize
\ No newline at end of file +sys_read in os::syscall::fs - Rust

Function os::syscall::fs::sys_read

source ·
pub fn sys_read(fd: usize, buf: *const u8, len: usize) -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/fs/fn.sys_write.html b/ch5/os/syscall/fs/fn.sys_write.html index 994d5840..4ab6081f 100644 --- a/ch5/os/syscall/fs/fn.sys_write.html +++ b/ch5/os/syscall/fs/fn.sys_write.html @@ -1,2 +1 @@ -sys_write in os::syscall::fs - Rust -

Function os::syscall::fs::sys_write

source ·
pub fn sys_write(fd: usize, buf: *const u8, len: usize) -> isize
\ No newline at end of file +sys_write in os::syscall::fs - Rust

Function os::syscall::fs::sys_write

source ·
pub fn sys_write(fd: usize, buf: *const u8, len: usize) -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/fs/index.html b/ch5/os/syscall/fs/index.html index 60811e16..a4e1f52c 100644 --- a/ch5/os/syscall/fs/index.html +++ b/ch5/os/syscall/fs/index.html @@ -1,3 +1,2 @@ -os::syscall::fs - Rust -

Module os::syscall::fs

source ·
Expand description

File and filesystem-related syscalls

-

Constants

Functions

\ No newline at end of file +os::syscall::fs - Rust

Module os::syscall::fs

source ·
Expand description

File and filesystem-related syscalls

+

Constants§

Functions§

\ No newline at end of file diff --git a/ch5/os/syscall/index.html b/ch5/os/syscall/index.html index 6801b1fc..bdb9e7a6 100644 --- a/ch5/os/syscall/index.html +++ b/ch5/os/syscall/index.html @@ -1,5 +1,4 @@ -os::syscall - Rust -

Module os::syscall

source ·
Expand description

Implementation of syscalls

+os::syscall - Rust

Module os::syscall

source ·
Expand description

Implementation of syscalls

The single entry point to all system calls, syscall(), is called whenever userspace wishes to perform a system call using the ecall instruction. In this case, the processor raises an ‘Environment call from @@ -8,4 +7,4 @@ U-mode’ exception, which is handled as one of the cases in

For clarity, each single syscall is implemented as its own function, named sys_ then the name of the syscall. You can find functions like this in submodules, and you should also implement syscalls this way.

-

Modules

  • fs 🔒
    File and filesystem-related syscalls
  • process 🔒

Constants

Functions

  • handle syscall exception with syscall_id and other arguments
\ No newline at end of file +

Modules§

  • fs 🔒
    File and filesystem-related syscalls
  • process 🔒

Constants§

Functions§

  • handle syscall exception with syscall_id and other arguments
\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_exec.html b/ch5/os/syscall/process/fn.sys_exec.html index c2fa233e..eef22fb7 100644 --- a/ch5/os/syscall/process/fn.sys_exec.html +++ b/ch5/os/syscall/process/fn.sys_exec.html @@ -1,2 +1 @@ -sys_exec in os::syscall::process - Rust -

Function os::syscall::process::sys_exec

source ·
pub fn sys_exec(path: *const u8) -> isize
\ No newline at end of file +sys_exec in os::syscall::process - Rust

Function os::syscall::process::sys_exec

source ·
pub fn sys_exec(path: *const u8) -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_exit.html b/ch5/os/syscall/process/fn.sys_exit.html index 23096d1a..80ccf712 100644 --- a/ch5/os/syscall/process/fn.sys_exit.html +++ b/ch5/os/syscall/process/fn.sys_exit.html @@ -1,2 +1 @@ -sys_exit in os::syscall::process - Rust -

Function os::syscall::process::sys_exit

source ·
pub fn sys_exit(exit_code: i32) -> !
\ No newline at end of file +sys_exit in os::syscall::process - Rust

Function os::syscall::process::sys_exit

source ·
pub fn sys_exit(exit_code: i32) -> !
\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_fork.html b/ch5/os/syscall/process/fn.sys_fork.html index af5afda4..83c4d739 100644 --- a/ch5/os/syscall/process/fn.sys_fork.html +++ b/ch5/os/syscall/process/fn.sys_fork.html @@ -1,2 +1 @@ -sys_fork in os::syscall::process - Rust -

Function os::syscall::process::sys_fork

source ·
pub fn sys_fork() -> isize
\ No newline at end of file +sys_fork in os::syscall::process - Rust

Function os::syscall::process::sys_fork

source ·
pub fn sys_fork() -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_get_time.html b/ch5/os/syscall/process/fn.sys_get_time.html index 235d1f4d..ba6254e6 100644 --- a/ch5/os/syscall/process/fn.sys_get_time.html +++ b/ch5/os/syscall/process/fn.sys_get_time.html @@ -1,2 +1 @@ -sys_get_time in os::syscall::process - Rust -

Function os::syscall::process::sys_get_time

source ·
pub fn sys_get_time() -> isize
\ No newline at end of file +sys_get_time in os::syscall::process - Rust

Function os::syscall::process::sys_get_time

source ·
pub fn sys_get_time() -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_getpid.html b/ch5/os/syscall/process/fn.sys_getpid.html index 851c6963..bf508ca3 100644 --- a/ch5/os/syscall/process/fn.sys_getpid.html +++ b/ch5/os/syscall/process/fn.sys_getpid.html @@ -1,2 +1 @@ -sys_getpid in os::syscall::process - Rust -

Function os::syscall::process::sys_getpid

source ·
pub fn sys_getpid() -> isize
\ No newline at end of file +sys_getpid in os::syscall::process - Rust

Function os::syscall::process::sys_getpid

source ·
pub fn sys_getpid() -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_waitpid.html b/ch5/os/syscall/process/fn.sys_waitpid.html index f5982d1f..6cf68e75 100644 --- a/ch5/os/syscall/process/fn.sys_waitpid.html +++ b/ch5/os/syscall/process/fn.sys_waitpid.html @@ -1,4 +1,3 @@ -sys_waitpid in os::syscall::process - Rust -

Function os::syscall::process::sys_waitpid

source ·
pub fn sys_waitpid(pid: isize, exit_code_ptr: *mut i32) -> isize
Expand description

If there is not a child process whose pid is same as given, return -1. +sys_waitpid in os::syscall::process - Rust

Function os::syscall::process::sys_waitpid

source ·
pub fn sys_waitpid(pid: isize, exit_code_ptr: *mut i32) -> isize
Expand description

If there is not a child process whose pid is same as given, return -1. Else if there is a child process but it is still running, return -2.

\ No newline at end of file diff --git a/ch5/os/syscall/process/fn.sys_yield.html b/ch5/os/syscall/process/fn.sys_yield.html index 4bd4049f..6932b848 100644 --- a/ch5/os/syscall/process/fn.sys_yield.html +++ b/ch5/os/syscall/process/fn.sys_yield.html @@ -1,2 +1 @@ -sys_yield in os::syscall::process - Rust -

Function os::syscall::process::sys_yield

source ·
pub fn sys_yield() -> isize
\ No newline at end of file +sys_yield in os::syscall::process - Rust

Function os::syscall::process::sys_yield

source ·
pub fn sys_yield() -> isize
\ No newline at end of file diff --git a/ch5/os/syscall/process/index.html b/ch5/os/syscall/process/index.html index c4848d50..18f61840 100644 --- a/ch5/os/syscall/process/index.html +++ b/ch5/os/syscall/process/index.html @@ -1,3 +1,2 @@ -os::syscall::process - Rust -

Module os::syscall::process

source ·

Functions

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/fn.add_initproc.html b/ch5/os/task/fn.add_initproc.html index e43cdfce..6d79a97d 100644 --- a/ch5/os/task/fn.add_initproc.html +++ b/ch5/os/task/fn.add_initproc.html @@ -1,3 +1,2 @@ -add_initproc in os::task - Rust -

Function os::task::add_initproc

source ·
pub fn add_initproc()
Expand description

Add init process to the manager

+add_initproc in os::task - Rust

Function os::task::add_initproc

source ·
pub fn add_initproc()
Expand description

Add init process to the manager

\ No newline at end of file diff --git a/ch5/os/task/fn.add_task.html b/ch5/os/task/fn.add_task.html index fc0a597b..5e655d33 100644 --- a/ch5/os/task/fn.add_task.html +++ b/ch5/os/task/fn.add_task.html @@ -1,3 +1,2 @@ -add_task in os::task - Rust -

Function os::task::add_task

source ·
pub fn add_task(task: Arc<TaskControlBlock>)
Expand description

Interface offered to add task

+add_task in os::task - Rust

Function os::task::add_task

source ·
pub fn add_task(task: Arc<TaskControlBlock>)
Expand description

Interface offered to add task

\ No newline at end of file diff --git a/ch5/os/task/fn.current_task.html b/ch5/os/task/fn.current_task.html index 719fc9d3..6a531698 100644 --- a/ch5/os/task/fn.current_task.html +++ b/ch5/os/task/fn.current_task.html @@ -1,3 +1,2 @@ -current_task in os::task - Rust -

Function os::task::current_task

source ·
pub fn current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Get running task

+current_task in os::task - Rust

Function os::task::current_task

source ·
pub fn current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Get running task

\ No newline at end of file diff --git a/ch5/os/task/fn.current_trap_cx.html b/ch5/os/task/fn.current_trap_cx.html index e8be6e84..ef912cb9 100644 --- a/ch5/os/task/fn.current_trap_cx.html +++ b/ch5/os/task/fn.current_trap_cx.html @@ -1,3 +1,2 @@ -current_trap_cx in os::task - Rust -

Function os::task::current_trap_cx

source ·
pub fn current_trap_cx() -> &'static mut TrapContext
Expand description

Get the mutable reference to trap context of current task

+current_trap_cx in os::task - Rust

Function os::task::current_trap_cx

source ·
pub fn current_trap_cx() -> &'static mut TrapContext
Expand description

Get the mutable reference to trap context of current task

\ No newline at end of file diff --git a/ch5/os/task/fn.current_user_token.html b/ch5/os/task/fn.current_user_token.html index bfa3bcea..80e6f50c 100644 --- a/ch5/os/task/fn.current_user_token.html +++ b/ch5/os/task/fn.current_user_token.html @@ -1,3 +1,2 @@ -current_user_token in os::task - Rust -

Function os::task::current_user_token

source ·
pub fn current_user_token() -> usize
Expand description

Get token of the address space of current task

+current_user_token in os::task - Rust

Function os::task::current_user_token

source ·
pub fn current_user_token() -> usize
Expand description

Get token of the address space of current task

\ No newline at end of file diff --git a/ch5/os/task/fn.exit_current_and_run_next.html b/ch5/os/task/fn.exit_current_and_run_next.html index fa5684d7..ffe4cdf2 100644 --- a/ch5/os/task/fn.exit_current_and_run_next.html +++ b/ch5/os/task/fn.exit_current_and_run_next.html @@ -1,3 +1,2 @@ -exit_current_and_run_next in os::task - Rust -
pub fn exit_current_and_run_next(exit_code: i32)
Expand description

Exit the current ‘Running’ task and run the next task in task list.

+exit_current_and_run_next in os::task - Rust

Function os::task::exit_current_and_run_next

source ·
pub fn exit_current_and_run_next(exit_code: i32)
Expand description

Exit the current ‘Running’ task and run the next task in task list.

\ No newline at end of file diff --git a/ch5/os/task/fn.fetch_task.html b/ch5/os/task/fn.fetch_task.html index ba7b1440..a563288a 100644 --- a/ch5/os/task/fn.fetch_task.html +++ b/ch5/os/task/fn.fetch_task.html @@ -1,3 +1,2 @@ -fetch_task in os::task - Rust -

Function os::task::fetch_task

source ·
pub fn fetch_task() -> Option<Arc<TaskControlBlock>>
Expand description

Interface offered to pop the first task

+fetch_task in os::task - Rust

Function os::task::fetch_task

source ·
pub fn fetch_task() -> Option<Arc<TaskControlBlock>>
Expand description

Interface offered to pop the first task

\ No newline at end of file diff --git a/ch5/os/task/fn.pid_alloc.html b/ch5/os/task/fn.pid_alloc.html index c2053d60..d2882e70 100644 --- a/ch5/os/task/fn.pid_alloc.html +++ b/ch5/os/task/fn.pid_alloc.html @@ -1,3 +1,2 @@ -pid_alloc in os::task - Rust -

Function os::task::pid_alloc

source ·
pub fn pid_alloc() -> PidHandle
Expand description

Allocate a pid from PID_ALLOCATOR

+pid_alloc in os::task - Rust

Function os::task::pid_alloc

source ·
pub fn pid_alloc() -> PidHandle
Expand description

Allocate a pid from PID_ALLOCATOR

\ No newline at end of file diff --git a/ch5/os/task/fn.run_tasks.html b/ch5/os/task/fn.run_tasks.html index 9f962ad7..e5f1d7ab 100644 --- a/ch5/os/task/fn.run_tasks.html +++ b/ch5/os/task/fn.run_tasks.html @@ -1,4 +1,3 @@ -run_tasks in os::task - Rust -

Function os::task::run_tasks

source ·
pub fn run_tasks()
Expand description

The main part of process execution and scheduling +run_tasks in os::task - Rust

Function os::task::run_tasks

source ·
pub fn run_tasks()
Expand description

The main part of process execution and scheduling Loop fetch_task to get the process that needs to run, and switch the process through __switch

\ No newline at end of file diff --git a/ch5/os/task/fn.schedule.html b/ch5/os/task/fn.schedule.html index 51acbd66..3f02778b 100644 --- a/ch5/os/task/fn.schedule.html +++ b/ch5/os/task/fn.schedule.html @@ -1,3 +1,2 @@ -schedule in os::task - Rust -

Function os::task::schedule

source ·
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
Expand description

Return to idle control flow for new scheduling

+schedule in os::task - Rust

Function os::task::schedule

source ·
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
Expand description

Return to idle control flow for new scheduling

\ No newline at end of file diff --git a/ch5/os/task/fn.suspend_current_and_run_next.html b/ch5/os/task/fn.suspend_current_and_run_next.html index e2266387..ff58d0af 100644 --- a/ch5/os/task/fn.suspend_current_and_run_next.html +++ b/ch5/os/task/fn.suspend_current_and_run_next.html @@ -1,3 +1,2 @@ -suspend_current_and_run_next in os::task - Rust -
pub fn suspend_current_and_run_next()
Expand description

Suspend the current ‘Running’ task and run the next task in task list.

+suspend_current_and_run_next in os::task - Rust

Function os::task::suspend_current_and_run_next

source ·
pub fn suspend_current_and_run_next()
Expand description

Suspend the current ‘Running’ task and run the next task in task list.

\ No newline at end of file diff --git a/ch5/os/task/fn.take_current_task.html b/ch5/os/task/fn.take_current_task.html index 8a2eb7d9..85c3346b 100644 --- a/ch5/os/task/fn.take_current_task.html +++ b/ch5/os/task/fn.take_current_task.html @@ -1,3 +1,2 @@ -take_current_task in os::task - Rust -

Function os::task::take_current_task

source ·
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Take the current task,leaving a None in its place

+take_current_task in os::task - Rust

Function os::task::take_current_task

source ·
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Take the current task,leaving a None in its place

\ No newline at end of file diff --git a/ch5/os/task/index.html b/ch5/os/task/index.html index 12784b94..14495378 100644 --- a/ch5/os/task/index.html +++ b/ch5/os/task/index.html @@ -1,5 +1,4 @@ -os::task - Rust -

Module os::task

source ·
Expand description

Task management implementation

+os::task - Rust

Module os::task

source ·
Expand description

Task management implementation

Everything about task management, like starting and switching tasks is implemented here.

A single global instance of TaskManager called TASK_MANAGER controls @@ -10,5 +9,5 @@ task(s) for each core.

pid for user apps.

Be careful when you see __switch ASM function in switch.S. Control flow around this function might not be what you expect.

-

Modules

Structs

Constants

  • pid of usertests app in make run TEST=1

Functions

Modules§

Structs§

Constants§

  • pid of usertests app in make run TEST=1

Functions§

\ No newline at end of file diff --git a/ch5/os/task/manager/fn.add_task.html b/ch5/os/task/manager/fn.add_task.html index 1141d866..f4ace77b 100644 --- a/ch5/os/task/manager/fn.add_task.html +++ b/ch5/os/task/manager/fn.add_task.html @@ -1,3 +1,2 @@ -add_task in os::task::manager - Rust -

Function os::task::manager::add_task

source ·
pub fn add_task(task: Arc<TaskControlBlock>)
Expand description

Interface offered to add task

+add_task in os::task::manager - Rust

Function os::task::manager::add_task

source ·
pub fn add_task(task: Arc<TaskControlBlock>)
Expand description

Interface offered to add task

\ No newline at end of file diff --git a/ch5/os/task/manager/fn.fetch_task.html b/ch5/os/task/manager/fn.fetch_task.html index 838047b9..c8ff32e5 100644 --- a/ch5/os/task/manager/fn.fetch_task.html +++ b/ch5/os/task/manager/fn.fetch_task.html @@ -1,3 +1,2 @@ -fetch_task in os::task::manager - Rust -

Function os::task::manager::fetch_task

source ·
pub fn fetch_task() -> Option<Arc<TaskControlBlock>>
Expand description

Interface offered to pop the first task

+fetch_task in os::task::manager - Rust

Function os::task::manager::fetch_task

source ·
pub fn fetch_task() -> Option<Arc<TaskControlBlock>>
Expand description

Interface offered to pop the first task

\ No newline at end of file diff --git a/ch5/os/task/manager/index.html b/ch5/os/task/manager/index.html index e997ee62..8069296c 100644 --- a/ch5/os/task/manager/index.html +++ b/ch5/os/task/manager/index.html @@ -1,3 +1,2 @@ -os::task::manager - Rust -

Module os::task::manager

source ·
Expand description

Implementation of TaskManager

-

Structs

Functions

\ No newline at end of file +os::task::manager - Rust

Module os::task::manager

source ·
Expand description

Implementation of TaskManager

+

Structs§

Functions§

\ No newline at end of file diff --git a/ch5/os/task/manager/struct.TASK_MANAGER.html b/ch5/os/task/manager/struct.TASK_MANAGER.html index 4908db3c..e8e213bb 100644 --- a/ch5/os/task/manager/struct.TASK_MANAGER.html +++ b/ch5/os/task/manager/struct.TASK_MANAGER.html @@ -1,15 +1,14 @@ -TASK_MANAGER in os::task::manager - Rust -

Struct os::task::manager::TASK_MANAGER

source ·
pub struct TASK_MANAGER {
+TASK_MANAGER in os::task::manager - Rust

Struct os::task::manager::TASK_MANAGER

source ·
pub struct TASK_MANAGER {
     __private_field: (),
 }

Fields§

§__private_field: ()

Methods from Deref<Target = UPSafeCell<TaskManager>>§

source

pub fn exclusive_access(&self) -> RefMut<'_, T>

Exclusive access inner data in UPSafeCell. Panic if the data has been borrowed.

-

Trait Implementations§

source§

impl Deref for TASK_MANAGER

§

type Target = UPSafeCell<TaskManager>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPSafeCell<TaskManager>

Dereferences the value.
source§

impl LazyStatic for TASK_MANAGER

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Deref for TASK_MANAGER

§

type Target = UPSafeCell<TaskManager>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPSafeCell<TaskManager>

Dereferences the value.
source§

impl LazyStatic for TASK_MANAGER

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/manager/struct.TaskManager.html b/ch5/os/task/manager/struct.TaskManager.html index c47520ff..20da9f00 100644 --- a/ch5/os/task/manager/struct.TaskManager.html +++ b/ch5/os/task/manager/struct.TaskManager.html @@ -1,19 +1,18 @@ -TaskManager in os::task::manager - Rust -

Struct os::task::manager::TaskManager

source ·
pub struct TaskManager {
+TaskManager in os::task::manager - Rust

Struct os::task::manager::TaskManager

source ·
pub struct TaskManager {
     ready_queue: VecDeque<Arc<TaskControlBlock>>,
 }
Expand description

A array of TaskControlBlock that is thread-safe

Fields§

§ready_queue: VecDeque<Arc<TaskControlBlock>>

Implementations§

source§

impl TaskManager

A simple FIFO scheduler.

source

pub fn new() -> Self

Creat an empty TaskManager

source

pub fn add(&mut self, task: Arc<TaskControlBlock>)

Add a task to TaskManager

source

pub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>>

Remove the first task and return it,or None if TaskManager is empty

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/pid/fn.kernel_stack_position.html b/ch5/os/task/pid/fn.kernel_stack_position.html index 7d28fd56..a4bc2ac5 100644 --- a/ch5/os/task/pid/fn.kernel_stack_position.html +++ b/ch5/os/task/pid/fn.kernel_stack_position.html @@ -1,3 +1,2 @@ -kernel_stack_position in os::task::pid - Rust -

Function os::task::pid::kernel_stack_position

source ·
pub fn kernel_stack_position(app_id: usize) -> (usize, usize)
Expand description

Return (bottom, top) of a kernel stack in kernel space.

+kernel_stack_position in os::task::pid - Rust

Function os::task::pid::kernel_stack_position

source ·
pub fn kernel_stack_position(app_id: usize) -> (usize, usize)
Expand description

Return (bottom, top) of a kernel stack in kernel space.

\ No newline at end of file diff --git a/ch5/os/task/pid/fn.pid_alloc.html b/ch5/os/task/pid/fn.pid_alloc.html index d2d1068c..25c7f00a 100644 --- a/ch5/os/task/pid/fn.pid_alloc.html +++ b/ch5/os/task/pid/fn.pid_alloc.html @@ -1,3 +1,2 @@ -pid_alloc in os::task::pid - Rust -

Function os::task::pid::pid_alloc

source ·
pub fn pid_alloc() -> PidHandle
Expand description

Allocate a pid from PID_ALLOCATOR

+pid_alloc in os::task::pid - Rust

Function os::task::pid::pid_alloc

source ·
pub fn pid_alloc() -> PidHandle
Expand description

Allocate a pid from PID_ALLOCATOR

\ No newline at end of file diff --git a/ch5/os/task/pid/index.html b/ch5/os/task/pid/index.html index f98c2eb7..1f540e61 100644 --- a/ch5/os/task/pid/index.html +++ b/ch5/os/task/pid/index.html @@ -1,3 +1,2 @@ -os::task::pid - Rust -

Module os::task::pid

source ·
Expand description

Implementation of PidAllocator

-

Structs

Functions

\ No newline at end of file +os::task::pid - Rust

Module os::task::pid

source ·
Expand description

Implementation of PidAllocator

+

Structs§

Functions§

\ No newline at end of file diff --git a/ch5/os/task/pid/struct.KernelStack.html b/ch5/os/task/pid/struct.KernelStack.html index f31ee096..5f64b0f5 100644 --- a/ch5/os/task/pid/struct.KernelStack.html +++ b/ch5/os/task/pid/struct.KernelStack.html @@ -1,19 +1,18 @@ -KernelStack in os::task::pid - Rust -

Struct os::task::pid::KernelStack

source ·
pub struct KernelStack {
+KernelStack in os::task::pid - Rust

Struct os::task::pid::KernelStack

source ·
pub struct KernelStack {
     pid: usize,
 }
Expand description

Kernelstack for app

Fields§

§pid: usize

Implementations§

source§

impl KernelStack

source

pub fn new(pid_handle: &PidHandle) -> Self

Create a kernelstack from pid

source

pub fn push_on_top<T>(&self, value: T) -> *mut T
where T: Sized,

Push a value on top of kernelstack

source

pub fn get_top(&self) -> usize

Get the value on the top of kernelstack

-

Trait Implementations§

source§

impl Drop for KernelStack

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Drop for KernelStack

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/pid/struct.PID_ALLOCATOR.html b/ch5/os/task/pid/struct.PID_ALLOCATOR.html index daae5281..9a8e4fb3 100644 --- a/ch5/os/task/pid/struct.PID_ALLOCATOR.html +++ b/ch5/os/task/pid/struct.PID_ALLOCATOR.html @@ -1,15 +1,14 @@ -PID_ALLOCATOR in os::task::pid - Rust -

Struct os::task::pid::PID_ALLOCATOR

source ·
pub struct PID_ALLOCATOR {
+PID_ALLOCATOR in os::task::pid - Rust

Struct os::task::pid::PID_ALLOCATOR

source ·
pub struct PID_ALLOCATOR {
     __private_field: (),
 }

Fields§

§__private_field: ()

Methods from Deref<Target = UPSafeCell<PidAllocator>>§

source

pub fn exclusive_access(&self) -> RefMut<'_, T>

Exclusive access inner data in UPSafeCell. Panic if the data has been borrowed.

-

Trait Implementations§

source§

impl Deref for PID_ALLOCATOR

§

type Target = UPSafeCell<PidAllocator>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPSafeCell<PidAllocator>

Dereferences the value.
source§

impl LazyStatic for PID_ALLOCATOR

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Deref for PID_ALLOCATOR

§

type Target = UPSafeCell<PidAllocator>

The resulting type after dereferencing.
source§

fn deref(&self) -> &UPSafeCell<PidAllocator>

Dereferences the value.
source§

impl LazyStatic for PID_ALLOCATOR

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/pid/struct.PidAllocator.html b/ch5/os/task/pid/struct.PidAllocator.html index 3162f7e0..8d3ea517 100644 --- a/ch5/os/task/pid/struct.PidAllocator.html +++ b/ch5/os/task/pid/struct.PidAllocator.html @@ -1,19 +1,18 @@ -PidAllocator in os::task::pid - Rust -

Struct os::task::pid::PidAllocator

source ·
pub struct PidAllocator {
+PidAllocator in os::task::pid - Rust

Struct os::task::pid::PidAllocator

source ·
pub struct PidAllocator {
     current: usize,
     recycled: Vec<usize>,
 }
Expand description

Pid Allocator struct

Fields§

§current: usize§recycled: Vec<usize>

Implementations§

source§

impl PidAllocator

source

pub fn new() -> Self

Create an empty PidAllocator

source

pub fn alloc(&mut self) -> PidHandle

Allocate a pid

source

pub fn dealloc(&mut self, pid: usize)

Recycle a pid

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/pid/struct.PidHandle.html b/ch5/os/task/pid/struct.PidHandle.html index 24f99ecd..a1a45054 100644 --- a/ch5/os/task/pid/struct.PidHandle.html +++ b/ch5/os/task/pid/struct.PidHandle.html @@ -1,13 +1,12 @@ -PidHandle in os::task::pid - Rust -

Struct os::task::pid::PidHandle

source ·
pub struct PidHandle(pub usize);
Expand description

Bind pid lifetime to PidHandle

-

Tuple Fields§

§0: usize

Trait Implementations§

source§

impl Drop for PidHandle

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +PidHandle in os::task::pid - Rust

Struct os::task::pid::PidHandle

source ·
pub struct PidHandle(pub usize);
Expand description

Bind pid lifetime to PidHandle

+

Tuple Fields§

§0: usize

Trait Implementations§

source§

impl Drop for PidHandle

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/processor/fn.current_task.html b/ch5/os/task/processor/fn.current_task.html index af9d554b..1fb6356f 100644 --- a/ch5/os/task/processor/fn.current_task.html +++ b/ch5/os/task/processor/fn.current_task.html @@ -1,3 +1,2 @@ -current_task in os::task::processor - Rust -

Function os::task::processor::current_task

source ·
pub fn current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Get running task

+current_task in os::task::processor - Rust

Function os::task::processor::current_task

source ·
pub fn current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Get running task

\ No newline at end of file diff --git a/ch5/os/task/processor/fn.current_trap_cx.html b/ch5/os/task/processor/fn.current_trap_cx.html index f464dff7..4726bf8b 100644 --- a/ch5/os/task/processor/fn.current_trap_cx.html +++ b/ch5/os/task/processor/fn.current_trap_cx.html @@ -1,3 +1,2 @@ -current_trap_cx in os::task::processor - Rust -

Function os::task::processor::current_trap_cx

source ·
pub fn current_trap_cx() -> &'static mut TrapContext
Expand description

Get the mutable reference to trap context of current task

+current_trap_cx in os::task::processor - Rust

Function os::task::processor::current_trap_cx

source ·
pub fn current_trap_cx() -> &'static mut TrapContext
Expand description

Get the mutable reference to trap context of current task

\ No newline at end of file diff --git a/ch5/os/task/processor/fn.current_user_token.html b/ch5/os/task/processor/fn.current_user_token.html index 36998af8..7eed17f6 100644 --- a/ch5/os/task/processor/fn.current_user_token.html +++ b/ch5/os/task/processor/fn.current_user_token.html @@ -1,3 +1,2 @@ -current_user_token in os::task::processor - Rust -
pub fn current_user_token() -> usize
Expand description

Get token of the address space of current task

+current_user_token in os::task::processor - Rust

Function os::task::processor::current_user_token

source ·
pub fn current_user_token() -> usize
Expand description

Get token of the address space of current task

\ No newline at end of file diff --git a/ch5/os/task/processor/fn.run_tasks.html b/ch5/os/task/processor/fn.run_tasks.html index 3d64b1c3..acd0f23b 100644 --- a/ch5/os/task/processor/fn.run_tasks.html +++ b/ch5/os/task/processor/fn.run_tasks.html @@ -1,4 +1,3 @@ -run_tasks in os::task::processor - Rust -

Function os::task::processor::run_tasks

source ·
pub fn run_tasks()
Expand description

The main part of process execution and scheduling +run_tasks in os::task::processor - Rust

Function os::task::processor::run_tasks

source ·
pub fn run_tasks()
Expand description

The main part of process execution and scheduling Loop fetch_task to get the process that needs to run, and switch the process through __switch

\ No newline at end of file diff --git a/ch5/os/task/processor/fn.schedule.html b/ch5/os/task/processor/fn.schedule.html index 6c8a1385..cdf99db3 100644 --- a/ch5/os/task/processor/fn.schedule.html +++ b/ch5/os/task/processor/fn.schedule.html @@ -1,3 +1,2 @@ -schedule in os::task::processor - Rust -

Function os::task::processor::schedule

source ·
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
Expand description

Return to idle control flow for new scheduling

+schedule in os::task::processor - Rust

Function os::task::processor::schedule

source ·
pub fn schedule(switched_task_cx_ptr: *mut TaskContext)
Expand description

Return to idle control flow for new scheduling

\ No newline at end of file diff --git a/ch5/os/task/processor/fn.take_current_task.html b/ch5/os/task/processor/fn.take_current_task.html index 10250875..c625a357 100644 --- a/ch5/os/task/processor/fn.take_current_task.html +++ b/ch5/os/task/processor/fn.take_current_task.html @@ -1,3 +1,2 @@ -take_current_task in os::task::processor - Rust -
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Take the current task,leaving a None in its place

+take_current_task in os::task::processor - Rust

Function os::task::processor::take_current_task

source ·
pub fn take_current_task() -> Option<Arc<TaskControlBlock>>
Expand description

Take the current task,leaving a None in its place

\ No newline at end of file diff --git a/ch5/os/task/processor/index.html b/ch5/os/task/processor/index.html index 4041c276..9ffd00e0 100644 --- a/ch5/os/task/processor/index.html +++ b/ch5/os/task/processor/index.html @@ -1,4 +1,3 @@ -os::task::processor - Rust -

Module os::task::processor

source ·
Expand description

Implementation of Processor and Intersection of control flow

-

Structs

Functions

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/processor/struct.Processor.html b/ch5/os/task/processor/struct.Processor.html index 9e4410b6..8209bde8 100644 --- a/ch5/os/task/processor/struct.Processor.html +++ b/ch5/os/task/processor/struct.Processor.html @@ -1,5 +1,4 @@ -Processor in os::task::processor - Rust -

Struct os::task::processor::Processor

source ·
pub struct Processor {
+Processor in os::task::processor - Rust

Struct os::task::processor::Processor

source ·
pub struct Processor {
     current: Option<Arc<TaskControlBlock>>,
     idle_task_cx: TaskContext,
 }
Expand description

Processor management structure

@@ -9,14 +8,14 @@
source

fn get_idle_task_cx_ptr(&mut self) -> *mut TaskContext

Get mutable reference to idle_task_cx

source

pub fn take_current(&mut self) -> Option<Arc<TaskControlBlock>>

Get current task in moving semanteme

source

pub fn current(&self) -> Option<Arc<TaskControlBlock>>

Get current task in cloning semanteme

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.INITPROC.html b/ch5/os/task/struct.INITPROC.html index 3c97b0fd..ccf37258 100644 --- a/ch5/os/task/struct.INITPROC.html +++ b/ch5/os/task/struct.INITPROC.html @@ -1,15 +1,14 @@ -INITPROC in os::task - Rust -

Struct os::task::INITPROC

source ·
pub struct INITPROC {
+INITPROC in os::task - Rust

Struct os::task::INITPROC

source ·
pub struct INITPROC {
     __private_field: (),
 }
Expand description

Globle process that init user shell

-

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for INITPROC

§

type Target = Arc<TaskControlBlock>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<TaskControlBlock>

Dereferences the value.
source§

impl LazyStatic for INITPROC

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Fields§

§__private_field: ()

Trait Implementations§

source§

impl Deref for INITPROC

§

type Target = Arc<TaskControlBlock>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Arc<TaskControlBlock>

Dereferences the value.
source§

impl LazyStatic for INITPROC

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.KernelStack.html b/ch5/os/task/struct.KernelStack.html index fd8e28c1..9fc3cf68 100644 --- a/ch5/os/task/struct.KernelStack.html +++ b/ch5/os/task/struct.KernelStack.html @@ -1,19 +1,18 @@ -KernelStack in os::task - Rust -

Struct os::task::KernelStack

source ·
pub struct KernelStack {
+KernelStack in os::task - Rust

Struct os::task::KernelStack

source ·
pub struct KernelStack {
     pid: usize,
 }
Expand description

Kernelstack for app

Fields§

§pid: usize

Implementations§

source§

impl KernelStack

source

pub fn new(pid_handle: &PidHandle) -> Self

Create a kernelstack from pid

source

pub fn push_on_top<T>(&self, value: T) -> *mut T
where T: Sized,

Push a value on top of kernelstack

source

pub fn get_top(&self) -> usize

Get the value on the top of kernelstack

-

Trait Implementations§

source§

impl Drop for KernelStack

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Drop for KernelStack

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.PidAllocator.html b/ch5/os/task/struct.PidAllocator.html index 73aeb03d..3fd0f86f 100644 --- a/ch5/os/task/struct.PidAllocator.html +++ b/ch5/os/task/struct.PidAllocator.html @@ -1,19 +1,18 @@ -PidAllocator in os::task - Rust -

Struct os::task::PidAllocator

source ·
pub struct PidAllocator {
+PidAllocator in os::task - Rust

Struct os::task::PidAllocator

source ·
pub struct PidAllocator {
     current: usize,
     recycled: Vec<usize>,
 }
Expand description

Pid Allocator struct

Fields§

§current: usize§recycled: Vec<usize>

Implementations§

source§

impl PidAllocator

source

pub fn new() -> Self

Create an empty PidAllocator

source

pub fn alloc(&mut self) -> PidHandle

Allocate a pid

source

pub fn dealloc(&mut self, pid: usize)

Recycle a pid

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.PidHandle.html b/ch5/os/task/struct.PidHandle.html index 49fbc04b..9fe44635 100644 --- a/ch5/os/task/struct.PidHandle.html +++ b/ch5/os/task/struct.PidHandle.html @@ -1,13 +1,12 @@ -PidHandle in os::task - Rust -

Struct os::task::PidHandle

source ·
pub struct PidHandle(pub usize);
Expand description

Bind pid lifetime to PidHandle

-

Tuple Fields§

§0: usize

Trait Implementations§

source§

impl Drop for PidHandle

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +PidHandle in os::task - Rust

Struct os::task::PidHandle

source ·
pub struct PidHandle(pub usize);
Expand description

Bind pid lifetime to PidHandle

+

Tuple Fields§

§0: usize

Trait Implementations§

source§

impl Drop for PidHandle

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.Processor.html b/ch5/os/task/struct.Processor.html index f3a013b3..daf85e39 100644 --- a/ch5/os/task/struct.Processor.html +++ b/ch5/os/task/struct.Processor.html @@ -1,5 +1,4 @@ -Processor in os::task - Rust -

Struct os::task::Processor

source ·
pub struct Processor {
+Processor in os::task - Rust

Struct os::task::Processor

source ·
pub struct Processor {
     current: Option<Arc<TaskControlBlock>>,
     idle_task_cx: TaskContext,
 }
Expand description

Processor management structure

@@ -9,14 +8,14 @@
source

fn get_idle_task_cx_ptr(&mut self) -> *mut TaskContext

Get mutable reference to idle_task_cx

source

pub fn take_current(&mut self) -> Option<Arc<TaskControlBlock>>

Get current task in moving semanteme

source

pub fn current(&self) -> Option<Arc<TaskControlBlock>>

Get current task in cloning semanteme

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.TaskContext.html b/ch5/os/task/struct.TaskContext.html index 4f20ef9e..c570fa6d 100644 --- a/ch5/os/task/struct.TaskContext.html +++ b/ch5/os/task/struct.TaskContext.html @@ -1,5 +1,4 @@ -TaskContext in os::task - Rust -

Struct os::task::TaskContext

source ·
#[repr(C)]
pub struct TaskContext { +TaskContext in os::task - Rust

Struct os::task::TaskContext

source ·
#[repr(C)]
pub struct TaskContext { ra: usize, sp: usize, s: [usize; 12], @@ -9,14 +8,14 @@
§s: [usize; 12]

s0-11 register, callee saved

Implementations§

source§

impl TaskContext

source

pub fn zero_init() -> Self

init task context

source

pub fn goto_trap_return(kstack_ptr: usize) -> Self

set Task Context{__restore ASM funciton: trap_return, sp: kstack_ptr, s: s_0..12}

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/struct.TaskManager.html b/ch5/os/task/struct.TaskManager.html index 2ecd20fe..5c1d33f3 100644 --- a/ch5/os/task/struct.TaskManager.html +++ b/ch5/os/task/struct.TaskManager.html @@ -1,19 +1,18 @@ -TaskManager in os::task - Rust -

Struct os::task::TaskManager

source ·
pub struct TaskManager {
+TaskManager in os::task - Rust

Struct os::task::TaskManager

source ·
pub struct TaskManager {
     ready_queue: VecDeque<Arc<TaskControlBlock>>,
 }
Expand description

A array of TaskControlBlock that is thread-safe

Fields§

§ready_queue: VecDeque<Arc<TaskControlBlock>>

Implementations§

source§

impl TaskManager

A simple FIFO scheduler.

source

pub fn new() -> Self

Creat an empty TaskManager

source

pub fn add(&mut self, task: Arc<TaskControlBlock>)

Add a task to TaskManager

source

pub fn fetch(&mut self) -> Option<Arc<TaskControlBlock>>

Remove the first task and return it,or None if TaskManager is empty

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/switch/fn.__switch.html b/ch5/os/task/switch/fn.__switch.html index 6a64bfa0..47f21a12 100644 --- a/ch5/os/task/switch/fn.__switch.html +++ b/ch5/os/task/switch/fn.__switch.html @@ -1,5 +1,4 @@ -__switch in os::task::switch - Rust -

Function os::task::switch::__switch

source ·
pub unsafe extern "C" fn __switch(
+__switch in os::task::switch - Rust

Function os::task::switch::__switch

source ·
pub unsafe extern "C" fn __switch(
     current_task_cx_ptr: *mut TaskContext,
     next_task_cx_ptr: *const TaskContext
 )
\ No newline at end of file diff --git a/ch5/os/task/switch/index.html b/ch5/os/task/switch/index.html index 16d71e29..e6b5d092 100644 --- a/ch5/os/task/switch/index.html +++ b/ch5/os/task/switch/index.html @@ -1,3 +1,2 @@ -os::task::switch - Rust -

Module os::task::switch

source ·
Expand description

Wrap switch.S as a function

-

Functions

\ No newline at end of file +os::task::switch - Rust

Module os::task::switch

source ·
Expand description

Wrap switch.S as a function

+

Functions§

\ No newline at end of file diff --git a/ch5/os/task/task/enum.TaskStatus.html b/ch5/os/task/task/enum.TaskStatus.html index ec8c1f8d..e25a792f 100644 --- a/ch5/os/task/task/enum.TaskStatus.html +++ b/ch5/os/task/task/enum.TaskStatus.html @@ -1,19 +1,18 @@ -TaskStatus in os::task::task - Rust -

Enum os::task::task::TaskStatus

source ·
pub enum TaskStatus {
+TaskStatus in os::task::task - Rust

Enum os::task::task::TaskStatus

source ·
pub enum TaskStatus {
     Ready,
     Running,
     Zombie,
-}

Variants§

§

Ready

§

Running

§

Zombie

Trait Implementations§

source§

impl Clone for TaskStatus

source§

fn clone(&self) -> TaskStatus

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq for TaskStatus

source§

fn eq(&self, other: &TaskStatus) -> bool

This method tests for self and other values to be equal, and is used -by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl Copy for TaskStatus

source§

impl StructuralPartialEq for TaskStatus

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Variants§

§

Ready

§

Running

§

Zombie

Trait Implementations§

source§

impl Clone for TaskStatus

source§

fn clone(&self) -> TaskStatus

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq for TaskStatus

source§

fn eq(&self, other: &TaskStatus) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
source§

impl Copy for TaskStatus

source§

impl StructuralPartialEq for TaskStatus

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file + T: Clone,
§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/task/index.html b/ch5/os/task/task/index.html index 798672f5..9eb618d5 100644 --- a/ch5/os/task/task/index.html +++ b/ch5/os/task/task/index.html @@ -1,3 +1,2 @@ -os::task::task - Rust -
\ No newline at end of file +os::task::task - Rust

Module os::task::task

source ·
Expand description

Implementation of TaskControlBlock

+

Structs§

Enums§

\ No newline at end of file diff --git a/ch5/os/task/task/struct.TaskControlBlock.html b/ch5/os/task/task/struct.TaskControlBlock.html index 28dccf5f..eaa49c8c 100644 --- a/ch5/os/task/task/struct.TaskControlBlock.html +++ b/ch5/os/task/task/struct.TaskControlBlock.html @@ -1,16 +1,15 @@ -TaskControlBlock in os::task::task - Rust -

Struct os::task::task::TaskControlBlock

source ·
pub struct TaskControlBlock {
+TaskControlBlock in os::task::task - Rust

Struct os::task::task::TaskControlBlock

source ·
pub struct TaskControlBlock {
     pub pid: PidHandle,
     pub kernel_stack: KernelStack,
     inner: UPSafeCell<TaskControlBlockInner>,
-}

Fields§

§pid: PidHandle§kernel_stack: KernelStack§inner: UPSafeCell<TaskControlBlockInner>

Implementations§

source§

impl TaskControlBlock

source

pub fn inner_exclusive_access(&self) -> RefMut<'_, TaskControlBlockInner>

source

pub fn new(elf_data: &[u8]) -> Self

source

pub fn exec(&self, elf_data: &[u8])

source

pub fn fork(self: &Arc<Self>) -> Arc<Self>

source

pub fn getpid(&self) -> usize

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Fields§

§pid: PidHandle§kernel_stack: KernelStack§inner: UPSafeCell<TaskControlBlockInner>

Implementations§

source§

impl TaskControlBlock

source

pub fn inner_exclusive_access(&self) -> RefMut<'_, TaskControlBlockInner>

source

pub fn new(elf_data: &[u8]) -> Self

source

pub fn exec(&self, elf_data: &[u8])

source

pub fn fork(self: &Arc<Self>) -> Arc<Self>

source

pub fn getpid(&self) -> usize

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/task/task/struct.TaskControlBlockInner.html b/ch5/os/task/task/struct.TaskControlBlockInner.html index 1d80ae69..00bbd141 100644 --- a/ch5/os/task/task/struct.TaskControlBlockInner.html +++ b/ch5/os/task/task/struct.TaskControlBlockInner.html @@ -1,5 +1,4 @@ -TaskControlBlockInner in os::task::task - Rust -
pub struct TaskControlBlockInner {
+TaskControlBlockInner in os::task::task - Rust

Struct os::task::task::TaskControlBlockInner

source ·
pub struct TaskControlBlockInner {
     pub trap_cx_ppn: PhysPageNum,
     pub base_size: usize,
     pub task_cx: TaskContext,
@@ -8,14 +7,14 @@
     pub parent: Option<Weak<TaskControlBlock>>,
     pub children: Vec<Arc<TaskControlBlock>>,
     pub exit_code: i32,
-}

Fields§

§trap_cx_ppn: PhysPageNum§base_size: usize§task_cx: TaskContext§task_status: TaskStatus§memory_set: MemorySet§parent: Option<Weak<TaskControlBlock>>§children: Vec<Arc<TaskControlBlock>>§exit_code: i32

Implementations§

source§

impl TaskControlBlockInner

source

pub fn get_trap_cx(&self) -> &'static mut TrapContext

source

pub fn get_user_token(&self) -> usize

source

fn get_status(&self) -> TaskStatus

source

pub fn is_zombie(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +}

Fields§

§trap_cx_ppn: PhysPageNum§base_size: usize§task_cx: TaskContext§task_status: TaskStatus§memory_set: MemorySet§parent: Option<Weak<TaskControlBlock>>§children: Vec<Arc<TaskControlBlock>>§exit_code: i32

Implementations§

source§

impl TaskControlBlockInner

source

pub fn get_trap_cx(&self) -> &'static mut TrapContext

source

pub fn get_user_token(&self) -> usize

source

fn get_status(&self) -> TaskStatus

source

pub fn is_zombie(&self) -> bool

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/timer/constant.MSEC_PER_SEC.html b/ch5/os/timer/constant.MSEC_PER_SEC.html index 9b645913..ccdf51e4 100644 --- a/ch5/os/timer/constant.MSEC_PER_SEC.html +++ b/ch5/os/timer/constant.MSEC_PER_SEC.html @@ -1,2 +1 @@ -MSEC_PER_SEC in os::timer - Rust -

Constant os::timer::MSEC_PER_SEC

source ·
const MSEC_PER_SEC: usize = 1000;
\ No newline at end of file +MSEC_PER_SEC in os::timer - Rust

Constant os::timer::MSEC_PER_SEC

source ·
const MSEC_PER_SEC: usize = 1000;
\ No newline at end of file diff --git a/ch5/os/timer/constant.TICKS_PER_SEC.html b/ch5/os/timer/constant.TICKS_PER_SEC.html index db6e239a..c5efecc6 100644 --- a/ch5/os/timer/constant.TICKS_PER_SEC.html +++ b/ch5/os/timer/constant.TICKS_PER_SEC.html @@ -1,2 +1 @@ -TICKS_PER_SEC in os::timer - Rust -

Constant os::timer::TICKS_PER_SEC

source ·
const TICKS_PER_SEC: usize = 100;
\ No newline at end of file +TICKS_PER_SEC in os::timer - Rust

Constant os::timer::TICKS_PER_SEC

source ·
const TICKS_PER_SEC: usize = 100;
\ No newline at end of file diff --git a/ch5/os/timer/fn.get_time.html b/ch5/os/timer/fn.get_time.html index b8e59810..af5ccef6 100644 --- a/ch5/os/timer/fn.get_time.html +++ b/ch5/os/timer/fn.get_time.html @@ -1,3 +1,2 @@ -get_time in os::timer - Rust -

Function os::timer::get_time

source ·
pub fn get_time() -> usize
Expand description

get current time

+get_time in os::timer - Rust

Function os::timer::get_time

source ·
pub fn get_time() -> usize
Expand description

get current time

\ No newline at end of file diff --git a/ch5/os/timer/fn.get_time_ms.html b/ch5/os/timer/fn.get_time_ms.html index e530e147..f77736f2 100644 --- a/ch5/os/timer/fn.get_time_ms.html +++ b/ch5/os/timer/fn.get_time_ms.html @@ -1,3 +1,2 @@ -get_time_ms in os::timer - Rust -

Function os::timer::get_time_ms

source ·
pub fn get_time_ms() -> usize
Expand description

get current time in microseconds

+get_time_ms in os::timer - Rust

Function os::timer::get_time_ms

source ·
pub fn get_time_ms() -> usize
Expand description

get current time in microseconds

\ No newline at end of file diff --git a/ch5/os/timer/fn.set_next_trigger.html b/ch5/os/timer/fn.set_next_trigger.html index 61903d46..312b1dfd 100644 --- a/ch5/os/timer/fn.set_next_trigger.html +++ b/ch5/os/timer/fn.set_next_trigger.html @@ -1,3 +1,2 @@ -set_next_trigger in os::timer - Rust -

Function os::timer::set_next_trigger

source ·
pub fn set_next_trigger()
Expand description

set the next timer interrupt

+set_next_trigger in os::timer - Rust

Function os::timer::set_next_trigger

source ·
pub fn set_next_trigger()
Expand description

set the next timer interrupt

\ No newline at end of file diff --git a/ch5/os/timer/index.html b/ch5/os/timer/index.html index c983f419..8ce1bdb2 100644 --- a/ch5/os/timer/index.html +++ b/ch5/os/timer/index.html @@ -1,3 +1,2 @@ -os::timer - Rust -

Module os::timer

source ·
Expand description

RISC-V timer-related functionality

-

Constants

Functions

\ No newline at end of file +os::timer - Rust

Module os::timer

source ·
Expand description

RISC-V timer-related functionality

+

Constants§

Functions§

\ No newline at end of file diff --git a/ch5/os/trap/context/index.html b/ch5/os/trap/context/index.html index 4452187d..219d3165 100644 --- a/ch5/os/trap/context/index.html +++ b/ch5/os/trap/context/index.html @@ -1,3 +1,2 @@ -os::trap::context - Rust -

Module os::trap::context

source ·
Expand description

Implementation of TrapContext

-

Structs

  • trap context structure containing sstatus, sepc and registers
\ No newline at end of file +os::trap::context - Rust

Module os::trap::context

source ·
Expand description

Implementation of TrapContext

+

Structs§

  • trap context structure containing sstatus, sepc and registers
\ No newline at end of file diff --git a/ch5/os/trap/context/struct.TrapContext.html b/ch5/os/trap/context/struct.TrapContext.html index 9eb929bc..a0185d07 100644 --- a/ch5/os/trap/context/struct.TrapContext.html +++ b/ch5/os/trap/context/struct.TrapContext.html @@ -1,5 +1,4 @@ -TrapContext in os::trap::context - Rust -

Struct os::trap::context::TrapContext

source ·
#[repr(C)]
pub struct TrapContext { +TrapContext in os::trap::context - Rust

Struct os::trap::context::TrapContext

source ·
#[repr(C)]
pub struct TrapContext { pub x: [usize; 32], pub sstatus: Sstatus, pub sepc: usize, @@ -21,14 +20,14 @@ kernel_sp: usize, trap_handler: usize ) -> Self

init app context

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/os/trap/fn.enable_timer_interrupt.html b/ch5/os/trap/fn.enable_timer_interrupt.html index dbc04907..c86a44af 100644 --- a/ch5/os/trap/fn.enable_timer_interrupt.html +++ b/ch5/os/trap/fn.enable_timer_interrupt.html @@ -1,3 +1,2 @@ -enable_timer_interrupt in os::trap - Rust -
pub fn enable_timer_interrupt()
Expand description

enable timer interrupt in sie CSR

+enable_timer_interrupt in os::trap - Rust

Function os::trap::enable_timer_interrupt

source ·
pub fn enable_timer_interrupt()
Expand description

enable timer interrupt in sie CSR

\ No newline at end of file diff --git a/ch5/os/trap/fn.init.html b/ch5/os/trap/fn.init.html index ceb06047..b00939bc 100644 --- a/ch5/os/trap/fn.init.html +++ b/ch5/os/trap/fn.init.html @@ -1,3 +1,2 @@ -init in os::trap - Rust -

Function os::trap::init

source ·
pub fn init()
Expand description

initialize CSR stvec as the entry of __alltraps

+init in os::trap - Rust

Function os::trap::init

source ·
pub fn init()
Expand description

initialize CSR stvec as the entry of __alltraps

\ No newline at end of file diff --git a/ch5/os/trap/fn.set_kernel_trap_entry.html b/ch5/os/trap/fn.set_kernel_trap_entry.html index c2188669..542a8b77 100644 --- a/ch5/os/trap/fn.set_kernel_trap_entry.html +++ b/ch5/os/trap/fn.set_kernel_trap_entry.html @@ -1,2 +1 @@ -set_kernel_trap_entry in os::trap - Rust -

Function os::trap::set_kernel_trap_entry

source ·
fn set_kernel_trap_entry()
\ No newline at end of file +set_kernel_trap_entry in os::trap - Rust

Function os::trap::set_kernel_trap_entry

source ·
fn set_kernel_trap_entry()
\ No newline at end of file diff --git a/ch5/os/trap/fn.set_user_trap_entry.html b/ch5/os/trap/fn.set_user_trap_entry.html index 09ad183c..39580681 100644 --- a/ch5/os/trap/fn.set_user_trap_entry.html +++ b/ch5/os/trap/fn.set_user_trap_entry.html @@ -1,2 +1 @@ -set_user_trap_entry in os::trap - Rust -

Function os::trap::set_user_trap_entry

source ·
fn set_user_trap_entry()
\ No newline at end of file +set_user_trap_entry in os::trap - Rust

Function os::trap::set_user_trap_entry

source ·
fn set_user_trap_entry()
\ No newline at end of file diff --git a/ch5/os/trap/fn.trap_from_kernel.html b/ch5/os/trap/fn.trap_from_kernel.html index 82777550..5da252a6 100644 --- a/ch5/os/trap/fn.trap_from_kernel.html +++ b/ch5/os/trap/fn.trap_from_kernel.html @@ -1,5 +1,4 @@ -trap_from_kernel in os::trap - Rust -

Function os::trap::trap_from_kernel

source ·
#[no_mangle]
+trap_from_kernel in os::trap - Rust

Function os::trap::trap_from_kernel

source ·
#[no_mangle]
 pub fn trap_from_kernel() -> !
Expand description

Unimplement: traps/interrupts/exceptions from kernel mode Todo: Chapter 9: I/O device

\ No newline at end of file diff --git a/ch5/os/trap/fn.trap_handler.html b/ch5/os/trap/fn.trap_handler.html index 05afb5a5..dd17249b 100644 --- a/ch5/os/trap/fn.trap_handler.html +++ b/ch5/os/trap/fn.trap_handler.html @@ -1,4 +1,3 @@ -trap_handler in os::trap - Rust -

Function os::trap::trap_handler

source ·
#[no_mangle]
+trap_handler in os::trap - Rust

Function os::trap::trap_handler

source ·
#[no_mangle]
 pub fn trap_handler() -> !
Expand description

handle an interrupt, exception, or system call from user space

\ No newline at end of file diff --git a/ch5/os/trap/fn.trap_return.html b/ch5/os/trap/fn.trap_return.html index 6e20105e..86ff1a07 100644 --- a/ch5/os/trap/fn.trap_return.html +++ b/ch5/os/trap/fn.trap_return.html @@ -1,5 +1,4 @@ -trap_return in os::trap - Rust -

Function os::trap::trap_return

source ·
#[no_mangle]
+trap_return in os::trap - Rust

Function os::trap::trap_return

source ·
#[no_mangle]
 pub fn trap_return() -> !
Expand description

set the new addr of __restore asm function in TRAMPOLINE page, set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table, finally, jump to new addr of __restore asm function

diff --git a/ch5/os/trap/index.html b/ch5/os/trap/index.html index f06df9da..93a38d00 100644 --- a/ch5/os/trap/index.html +++ b/ch5/os/trap/index.html @@ -1,5 +1,4 @@ -os::trap - Rust -

Module os::trap

source ·
Expand description

Trap handling functionality

+os::trap - Rust

Module os::trap

source ·
Expand description

Trap handling functionality

For rCore, we have a single trap entry point, namely __alltraps. At initialization in init(), we set the stvec CSR to point to it.

All traps go through __alltraps, which is defined in trap.S. The @@ -9,7 +8,7 @@ context, ensuring that Rust code safely runs, and transfers control to

It then calls different functionality based on what exactly the exception was. For example, timer interrupts trigger task preemption, and syscalls go to syscall().

-

Modules

Structs

  • trap context structure containing sstatus, sepc and registers

Functions

Modules§

Structs§

  • trap context structure containing sstatus, sepc and registers

Functions§

  • enable timer interrupt in sie CSR
  • initialize CSR stvec as the entry of __alltraps
  • Unimplement: traps/interrupts/exceptions from kernel mode Todo: Chapter 9: I/O device
  • handle an interrupt, exception, or system call from user space
  • set the new addr of __restore asm function in TRAMPOLINE page, set the reg a0 = trap_cx_ptr, reg a1 = phy addr of usr page table, finally, jump to new addr of __restore asm function
\ No newline at end of file diff --git a/ch5/os/trap/struct.TrapContext.html b/ch5/os/trap/struct.TrapContext.html index ebf3a81e..74090b68 100644 --- a/ch5/os/trap/struct.TrapContext.html +++ b/ch5/os/trap/struct.TrapContext.html @@ -1,5 +1,4 @@ -TrapContext in os::trap - Rust -

Struct os::trap::TrapContext

source ·
#[repr(C)]
pub struct TrapContext { +TrapContext in os::trap - Rust

Struct os::trap::TrapContext

source ·
#[repr(C)]
pub struct TrapContext { pub x: [usize; 32], pub sstatus: Sstatus, pub sepc: usize, @@ -21,14 +20,14 @@ kernel_sp: usize, trap_handler: usize ) -> Self

init app context

-

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

-
source§

impl<T, U> Into<U> for T
where - U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

+ T: ?Sized,
source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
source§

impl<T, U> Into<U> for T
where + U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

-
source§

impl<T, U> TryFrom<U> for T
where - U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where - U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file +
source§

impl<T, U> TryFrom<U> for T
where + U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where + U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
\ No newline at end of file diff --git a/ch5/search-index.js b/ch5/search-index.js index 49d37fe9..b81ee40b 100644 --- a/ch5/search-index.js +++ b/ch5/search-index.js @@ -1,5 +1,5 @@ var searchIndex = new Map(JSON.parse('[\ -["os",{"doc":"The main module and entrypoint","t":"CHCCCCCQQHCCCCCCSSSESSEESSSSSFNNNNHNNNNHFONNNNHHHNHNNNFEEFFFFFFFFOCOOOHCCHCCOOHHHHSSFFFFKSISFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNOOMNNNNNNNNNNNNNNNNNNNNNNNNFKIFFOMNNNNNNNOOMNNNOONHHHNNNNHNNNMNNOOONNNNNNNNNJJHHHPPFFFGFTTTTONNONNNNNONNNNNNNNNNNNNNNNNNNNONNHHHNNNHHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONONNNNONNNHNNHHNHHHNNNNNNNNNNNNNNNNNNNNNNNNNNOTTTFFFTTTTTNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNHHHNNNNNNNNNNNNHHHHFOCFNNNNONNNNNSSSSSSSSSCCHSSHHHHHHHHHSFFFFFFFOHHNNCOOHHHNHHNONCCOHCOOOHOHOHCHCNNNFNNNNNOOONNNNFFONHNNNNNNHNNNNNONNNNNNFFFFONNNNNNNNNONNNNNNNNNNNNNHNNOHNONNNNNNNNNNNNFFONNNNNOHHHNNNNONNNHHNHNNNNNNHPPFFGPONNNNNNONNNNONNNNNNNNONNNNNOONOOOONONNNNNNNNNSSHHHFCHHOOOHHOHHOHOFNNNNNOOONOONNNO","n":["board","clear_bss","config","console","lang_items","loader","mm","print","println","rust_main","sbi","sync","syscall","task","timer","trap","CLOCK_FREQ","MEMORY_END","MMIO","CLOCK_FREQ","KERNEL_HEAP_SIZE","KERNEL_STACK_SIZE","MEMORY_END","MMIO","PAGE_SIZE","PAGE_SIZE_BITS","TRAMPOLINE","TRAP_CONTEXT","USER_STACK_SIZE","Stdout","borrow","borrow_mut","from","into","print","try_from","try_into","type_id","write_str","panic","APP_NAMES","__private_field","borrow","borrow_mut","deref","from","get_app_data","get_app_data_by_name","get_num_app","into","list_apps","try_from","try_into","type_id","FrameTracker","KERNEL_SPACE","KERNEL_SPACE","KERNEL_SPACE","MapPermission","MemorySet","PageTableEntry","PhysAddr","PhysPageNum","VirtAddr","VirtPageNum","__private_field","address","areas","bits","bits","frame_alloc","frame_allocator","heap_allocator","init","memory_set","page_table","page_table","ppn","remap_test","translated_byte_buffer","translated_refmut","translated_str","PA_WIDTH_SV39","PPN_WIDTH_SV39","PhysAddr","PhysPageNum","SimpleRange","SimpleRangeIterator","StepByOne","VA_WIDTH_SV39","VPNRange","VPN_WIDTH_SV39","VirtAddr","VirtPageNum","aligned","aligned","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","ceil","ceil","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","current","end","eq","eq","eq","eq","floor","floor","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_bytes_array","get_end","get_mut","get_mut","get_pte_array","get_start","indexes","into","into","into","into","into","into","into_iter","into_iter","l","l","new","new","next","page_offset","page_offset","partial_cmp","partial_cmp","partial_cmp","partial_cmp","r","r","step","step","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","FRAME_ALLOCATOR","FrameAllocator","FrameAllocatorImpl","FrameTracker","StackFrameAllocator","__private_field","alloc","alloc","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","current","current","dealloc","dealloc","deref","drop","end","end","fmt","frame_alloc","frame_allocator_test","frame_dealloc","from","from","from","init","init_frame_allocator","into","into","into","new","new","new","ppn","recycled","recycled","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","HEAP_ALLOCATOR","HEAP_SPACE","handle_alloc_error","heap_test","init_heap","Framed","Identical","KERNEL_SPACE","MapArea","MapPermission","MapType","MemorySet","R","U","W","X","__private_field","activate","all","areas","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","complement","contains","copy_data","data_frames","deref","difference","ebss","edata","ekernel","empty","eq","eq","erodata","etext","extend","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_another","from_bits","from_bits_truncate","from_bits_unchecked","from_elf","from_existed_user","from_iter","hash","insert","insert_framed_area","intersection","intersects","into","into","into","into","into","is_all","is_empty","map","map_one","map_perm","map_trampoline","map_type","new","new_bare","new_kernel","not","page_table","partial_cmp","push","recycle_data_pages","remap_test","remove","remove_area_with_start_vpn","sbss_with_stack","sdata","set","srodata","stext","strampoline","sub","sub_assign","symmetric_difference","to_owned","to_owned","toggle","token","translate","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","union","unmap","unmap_one","vpn_range","A","D","G","PTEFlags","PageTable","PageTableEntry","R","U","V","W","X","all","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","complement","contains","difference","empty","empty","eq","executable","extend","find_pte","find_pte_create","flags","fmt","fmt","fmt","fmt","fmt","frames","from","from","from","from_bits","from_bits_truncate","from_bits_unchecked","from_iter","from_token","hash","insert","intersection","intersects","into","into","into","is_all","is_empty","is_valid","map","new","new","not","partial_cmp","ppn","readable","remove","root_ppn","set","sub","sub_assign","symmetric_difference","to_owned","to_owned","toggle","token","translate","translate_va","translated_byte_buffer","translated_refmut","translated_str","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","union","unmap","writable","console_getchar","console_putchar","set_timer","shutdown","UPSafeCell","inner","up","UPSafeCell","borrow","borrow_mut","exclusive_access","from","inner","into","new","try_from","try_into","type_id","SYSCALL_EXEC","SYSCALL_EXIT","SYSCALL_FORK","SYSCALL_GETPID","SYSCALL_GET_TIME","SYSCALL_READ","SYSCALL_WAITPID","SYSCALL_WRITE","SYSCALL_YIELD","fs","process","syscall","FD_STDIN","FD_STDOUT","sys_read","sys_write","sys_exec","sys_exit","sys_fork","sys_get_time","sys_getpid","sys_waitpid","sys_yield","IDLE_PID","INITPROC","KernelStack","PidAllocator","PidHandle","Processor","TaskContext","TaskManager","__private_field","add_initproc","add_task","borrow","borrow_mut","context","current","current","current_task","current_trap_cx","current_user_token","deref","exit_current_and_run_next","fetch_task","from","idle_task_cx","into","manager","pid","pid","pid_alloc","processor","ra","ready_queue","recycled","run_tasks","s","schedule","sp","suspend_current_and_run_next","switch","take_current_task","task","try_from","try_into","type_id","TaskContext","borrow","borrow_mut","from","goto_trap_return","into","ra","s","sp","try_from","try_into","type_id","zero_init","TASK_MANAGER","TaskManager","__private_field","add","add_task","borrow","borrow","borrow_mut","borrow_mut","deref","fetch","fetch_task","from","from","into","into","new","ready_queue","try_from","try_from","try_into","try_into","type_id","type_id","KernelStack","PID_ALLOCATOR","PidAllocator","PidHandle","__private_field","alloc","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","current","dealloc","deref","drop","drop","from","from","from","from","get_top","into","into","into","into","kernel_stack_position","new","new","pid","pid_alloc","push_on_top","recycled","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","PROCESSOR","Processor","__private_field","borrow","borrow","borrow_mut","borrow_mut","current","current","current_task","current_trap_cx","current_user_token","deref","from","from","get_idle_task_cx_ptr","idle_task_cx","into","into","new","run_tasks","schedule","take_current","take_current_task","try_from","try_from","try_into","try_into","type_id","type_id","__switch","Ready","Running","TaskControlBlock","TaskControlBlockInner","TaskStatus","Zombie","base_size","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","children","clone","clone_into","eq","exec","exit_code","fork","from","from","from","get_status","get_trap_cx","get_user_token","getpid","inner","inner_exclusive_access","into","into","into","is_zombie","kernel_stack","memory_set","new","parent","pid","task_cx","task_status","to_owned","trap_cx_ppn","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","MSEC_PER_SEC","TICKS_PER_SEC","get_time","get_time_ms","set_next_trigger","TrapContext","context","enable_timer_interrupt","init","kernel_satp","kernel_sp","sepc","set_kernel_trap_entry","set_user_trap_entry","sstatus","trap_from_kernel","trap_handler","trap_handler","trap_return","x","TrapContext","app_init_context","borrow","borrow_mut","from","into","kernel_satp","kernel_sp","sepc","set_sp","sstatus","trap_handler","try_from","try_into","type_id","x"],"q":[[0,"os"],[16,"os::board"],[19,"os::config"],[29,"os::console"],[39,"os::lang_items"],[40,"os::loader"],[54,"os::mm"],[82,"os::mm::address"],[203,"os::mm::frame_allocator"],[252,"os::mm::heap_allocator"],[257,"os::mm::memory_set"],[389,"os::mm::page_table"],[490,"os::sbi"],[494,"os::sync"],[497,"os::sync::up"],[508,"os::syscall"],[520,"os::syscall::fs"],[524,"os::syscall::process"],[531,"os::task"],[575,"os::task::context"],[588,"os::task::manager"],[612,"os::task::pid"],[659,"os::task::processor"],[689,"os::task::switch"],[690,"os::task::task"],[741,"os::timer"],[746,"os::trap"],[761,"os::trap::context"],[777,"core::fmt"],[778,"core::result"],[779,"core::any"],[780,"core::fmt"],[781,"alloc::vec"],[782,"core::option"],[783,"alloc::string"],[784,"core::marker"],[785,"core::cmp"],[786,"core::cmp"],[787,"core::cmp"],[788,"alloc::sync"],[789,"core::iter::traits::collect"],[790,"core::hash"],[791,"core::cell"],[792,"core::marker"]],"d":["Constants used in rCore for qemu","clear BSS segment","Constants used in rCore","SBI console driver, for text output","The panic handler","Loading user applications into memory","Memory management implementation","print string macro","println string macro","the rust entry-point of os","SBI call wrappers","Synchronization and interior mutability primitives","Implementation of syscalls","Task management implementation","RISC-V timer-related functionality","Trap handling functionality","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Calls U::from(self).","","","","","","","All of app’s name","","","","","Returns the argument unchanged.","get applications data","get app data from name","get app number","Calls U::from(self).","list all apps","","","","manage a frame which has the same lifecycle as the tracker","","","a memory set instance through lazy_static! managing kernel …","map permission corresponding to that in pte: R W X U","memory set structure, controls virtual-memory space","page table entry structure","physical address","physical page number","virtual address","virtual page number","","Implementation of physical and virtual address and page …","","","PTE","allocate a frame","Implementation of FrameAllocator which controls all the …","The global allocator","initiate heap allocator, frame allocator and kernel space","Implementation of MapArea and MemorySet.","Implementation of PageTableEntry and PageTable.","","","Check PageTable running correctly","translate a pointer to a mutable u8 Vec through page table","translate a generic through page table and return a …","translate a pointer to a mutable u8 Vec end with \\\\0 …","physical address","","physical address","physical page number","a simple range structure for type T","iterator for the simple range structure","","","a simple range structure for virtual page number","","virtual address","virtual page number","Check page aligned","Check page aligned","","","","","","","","","","","","","PhysAddr->PhysPageNum","VirtAddr->VirtPageNum","","","","","","","","","","","","","","","","","","","","","PhysAddr->PhysPageNum","VirtAddr->VirtPageNum","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","","","Get mutable reference to PhysAddr value","","Get PageTableEntry on PhysPageNum","","Return VPN 3 level index","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","Get page offset","Get page offset","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","frame allocator instance through lazy_static!","","","manage a frame which has the same lifecycle as the tracker","an implementation for frame allocator","","","","","","","","","","","","","","","","","","","allocate a frame","a simple test for frame allocator","deallocate a frame","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","initiate the frame allocator using ekernel and MEMORY_END","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","Create an empty FrameTracker","","","","","","","","","","","","","","heap allocator instance","heap space ([u8; KERNEL_HEAP_SIZE])","panic when heap allocation error occurs","","initiate heap allocator","","","a memory set instance through lazy_static! managing kernel …","map area structure, controls a contiguous piece of virtual …","map permission corresponding to that in pte: R W X U","map type for memory set: identical or framed","memory set structure, controls virtual-memory space","Readable","Accessible in U mode","Writable","Excutable","","Refresh TLB with sfence.vma","Returns the set containing all flags.","","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","","Returns the left flags, but with all the right flags …","Toggles the set of flags.","","","","","","","","","","","","","","","","Returns the complement of this set of flags.","Returns true if all of the flags in other are contained …","data: start-aligned but maybe with shorter length assume …","","","Returns the difference between the flags in self and other.","","","","Returns an empty set of flags.","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","Include sections in elf and trampoline and TrapContext and …","Clone a same MemorySet","","","Inserts the specified flags in-place.","Assume that no conflicts.","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","","","","Mention that trampoline is not collected by areas.","","","Create an empty MemorySet","Without kernel stacks.","Returns the complement of this set of flags.","","","","Remove all MapArea","Check PageTable running correctly","Removes the specified flags in-place.","Remove MapArea that starts with start_vpn","","","Inserts or removes the specified flags depending on the …","","","","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","","","Toggles the specified flags in-place.","Get pagetable root_ppn","Translate throuth pagetable","","","","","","","","","","","","","","","","Returns the union of between the flags in self and other.","","","","","","","","","page table entry structure","","","","","","Returns the set containing all flags.","Returns the intersection between the two sets of flags.","Disables all flags disabled in the set.","Returns the union of the two sets of flags.","Adds the set of flags.","Returns the raw value of the flags currently stored.","","PTE","Returns the left flags, but with all the right flags …","Toggles the set of flags.","","","","","","","","","","","","Returns the complement of this set of flags.","Returns true if all of the flags in other are contained …","Returns the difference between the flags in self and other.","Returns an empty set of flags.","Return an empty PTE","","Check PTE executable","","","","Return 10bit flag","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Convert from underlying bit representation, unless that …","Convert from underlying bit representation, dropping any …","Convert from underlying bit representation, preserving all …","","Temporarily used to get arguments from user space.","","Inserts the specified flags in-place.","Returns the intersection between the flags in self and …","Returns true if there are flags common to both self and …","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Returns true if all flags are currently set.","Returns true if no flags are currently stored.","Check PTE valid","","","Create a PTE from ppn","Returns the complement of this set of flags.","","Return 44bit ppn","Check PTE readable","Removes the specified flags in-place.","","Inserts or removes the specified flags depending on the …","Returns the set difference of the two sets of flags.","Disables all flags enabled in the set.","Returns the symmetric difference between the flags in self …","","","Toggles the specified flags in-place.","","","","translate a pointer to a mutable u8 Vec through page table","translate a generic through page table and return a …","translate a pointer to a mutable u8 Vec end with \\\\0 …","","","","","","","","","","Returns the union of between the flags in self and other.","","Check PTE writable","use sbi call to getchar from console (qemu uart handler)","use sbi call to putchar in console (qemu uart handler)","use sbi call to set timer","use sbi call to shutdown the kernel","Wrap a static data structure inside it so that we are able …","inner data","Uniprocessor interior mutability primitives","Wrap a static data structure inside it so that we are able …","","","Exclusive access inner data in UPSafeCell. Panic if the …","Returns the argument unchanged.","inner data","Calls U::from(self).","User is responsible to guarantee that inner struct is only …","","","","","","","","","","","","","File and filesystem-related syscalls","","handle syscall exception with syscall_id and other …","","","","","","","","","","If there is not a child process whose pid is same as …","","pid of usertests app in make run TEST=1","Globle process that init user shell","Kernelstack for app","Pid Allocator struct","Bind pid lifetime to PidHandle","Processor management structure","task context structure containing some registers","A array of TaskControlBlock that is thread-safe","","Add init process to the manager","Interface offered to add task","","","Implementation of TaskContext","","The task currently executing on the current processor","Get running task","Get the mutable reference to trap context of current task","Get token of the address space of current task","","Exit the current ‘Running’ task and run the next task …","Interface offered to pop the first task","Returns the argument unchanged.","The basic control flow of each core, helping to select and …","Calls U::from(self).","Implementation of TaskManager","Implementation of PidAllocator","","Allocate a pid from PID_ALLOCATOR","Implementation of Processor and Intersection of control …","return address ( e.g. __restore ) of __switch ASM function","","","The main part of process execution and scheduling Loop …","s0-11 register, callee saved","Return to idle control flow for new scheduling","kernel stack pointer of app","Suspend the current ‘Running’ task and run the next …","Wrap switch.S as a function","Take the current task,leaving a None in its place","Implementation of TaskControlBlock","","","","task context structure containing some registers","","","Returns the argument unchanged.","set Task Context{__restore ASM funciton: trap_return, sp: …","Calls U::from(self).","return address ( e.g. __restore ) of __switch ASM function","s0-11 register, callee saved","kernel stack pointer of app","","","","init task context","","A array of TaskControlBlock that is thread-safe","","Add a task to TaskManager","Interface offered to add task","","","","","","Remove the first task and return it,or None if TaskManager …","Interface offered to pop the first task","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self).","Calls U::from(self).","Creat an empty TaskManager","","","","","","","","Kernelstack for app","","Pid Allocator struct","Bind pid lifetime to PidHandle","","Allocate a pid","","","","","","","","","","Recycle a pid","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Get the value on the top of kernelstack","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Return (bottom, top) of a kernel stack in kernel space.","Create an empty PidAllocator","Create a kernelstack from pid","","Allocate a pid from PID_ALLOCATOR","Push a value on top of kernelstack","","","","","","","","","","","","","","","Processor management structure","","","","","","Get current task in cloning semanteme","The task currently executing on the current processor","Get running task","Get the mutable reference to trap context of current task","Get token of the address space of current task","","Returns the argument unchanged.","Returns the argument unchanged.","Get mutable reference to idle_task_cx","The basic control flow of each core, helping to select and …","Calls U::from(self).","Calls U::from(self).","Create an empty Processor","The main part of process execution and scheduling Loop …","Return to idle control flow for new scheduling","Get current task in moving semanteme","Take the current task,leaving a None in its place","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","get current time","get current time in microseconds","set the next timer interrupt","trap context structure containing sstatus, sepc and …","Implementation of TrapContext","enable timer interrupt in sie CSR","initialize CSR stvec as the entry of __alltraps","Addr of Page Table","kernel stack","CSR sepc","","","CSR sstatus ","Unimplement: traps/interrupts/exceptions from kernel mode …","handle an interrupt, exception, or system call from user …","Addr of trap_handler function","set the new addr of __restore asm function in TRAMPOLINE …","general regs[0..31]","trap context structure containing sstatus, sepc and …","init app context","","","Returns the argument unchanged.","Calls U::from(self).","Addr of Page Table","kernel stack","CSR sepc","set stack pointer to x_2 reg (sp)","CSR sstatus ","Addr of trap_handler function","","","","general regs[0..31]"],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,6,6,6,6,0,0,10,10,10,10,10,0,0,0,10,0,10,10,10,0,0,0,0,0,0,0,0,0,0,0,45,0,40,41,32,0,0,0,0,0,0,40,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,20,34,18,20,21,22,23,34,18,20,21,22,23,18,20,18,20,21,22,23,18,20,21,22,23,18,20,21,22,34,34,18,20,21,22,18,20,18,20,21,22,34,18,18,18,20,20,20,21,21,21,22,22,22,23,21,23,18,21,21,23,22,34,18,20,21,22,23,34,23,70,23,34,23,34,18,20,18,20,21,22,70,23,24,22,18,20,21,22,23,34,18,20,21,22,23,34,18,20,21,22,23,34,18,20,21,22,23,0,0,0,0,0,37,35,36,16,36,37,16,36,37,36,71,35,36,37,16,36,71,16,0,0,0,16,36,37,36,0,16,36,37,35,16,36,16,36,71,16,36,37,16,36,37,16,36,37,0,0,0,0,0,42,42,0,0,0,0,0,41,41,41,41,45,40,41,40,41,41,41,41,41,41,41,41,40,43,45,42,41,40,43,45,42,41,42,41,42,41,41,41,41,43,43,45,41,0,0,0,41,42,41,0,0,41,42,41,41,41,41,41,40,43,45,42,41,43,41,41,41,40,40,41,41,41,40,41,41,40,43,45,42,41,41,41,43,43,43,40,43,43,40,40,41,40,41,40,40,0,41,40,0,0,41,0,0,0,41,41,41,42,41,41,40,40,40,43,45,42,41,40,43,45,42,41,40,43,45,42,41,41,43,43,43,51,51,51,0,0,0,51,51,51,51,51,51,51,51,51,51,51,51,32,51,51,44,51,32,44,51,32,51,32,51,32,51,51,51,51,51,32,51,32,51,44,44,32,51,51,51,51,51,44,44,51,32,51,51,51,51,44,51,51,51,51,44,51,32,51,51,32,44,44,32,51,51,32,32,51,44,51,51,51,51,51,32,51,44,44,44,0,0,0,44,51,32,44,51,32,44,51,32,51,44,32,0,0,0,0,0,38,0,0,38,38,38,38,38,38,38,38,38,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,0,0,57,57,0,62,66,0,0,0,57,0,0,57,66,57,0,0,64,0,0,59,60,62,0,59,0,59,0,0,0,0,57,57,57,0,59,59,59,59,59,59,59,59,59,59,59,59,0,0,61,60,0,60,61,60,61,61,60,0,60,61,60,61,60,60,60,61,60,61,60,61,0,0,0,0,63,62,62,58,64,63,62,58,64,63,62,62,63,58,64,62,58,64,63,64,62,58,64,63,0,62,64,64,0,64,62,62,58,64,63,62,58,64,63,62,58,64,63,0,0,67,66,67,66,67,66,66,0,0,0,67,66,67,66,66,66,67,66,0,0,66,0,66,67,66,67,66,67,0,68,68,0,0,0,68,69,55,69,68,55,69,68,69,68,68,68,55,69,55,55,69,68,69,69,69,55,55,55,55,69,68,69,55,69,55,69,55,69,69,68,69,55,69,68,55,69,68,55,69,68,0,0,0,0,0,0,0,0,0,56,56,56,0,0,56,0,0,56,0,56,0,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56],"f":"`{{}b}```````{{}d}````````````````````{ce{}{}}0{cc{}}1{fb}{c{{h{e}}}{}{}}0{cj{}}{{ln}A`}{Abd}``66{Ad{{Af{n}}}}6{Ah{{Al{Aj}}}}{n{{An{{Al{Aj}}}}}}{{}Ah}:<776````````````````{{}{{An{B`}}}}``=````={{AhAjAh}{{Af{{Al{Aj}}}}}}{Ahc{}}{{AhAj}Bb}````````````{BdBf}{BhBf}{ce{}{}}00000000000{BdBj}{BhBl}{BdBd}{BhBh}{BjBj}{BlBl}{{{Bn{c}}}{{Bn{c}}}{C`CbCdCfChCj}}{{ce}b{}{}}0000{{BdBd}Cl}{{BhBh}Cl}{{BjBj}Cl}{{BlBl}Cl}``{{BdBd}Bf}{{BhBh}Bf}{{BjBj}Bf}{{BlBl}Bf}?>{{BdCn}A`}{{BhCn}A`}{{BjCn}A`}{{BlCn}A`}{cc{}}{BjBd}1{AhBd}2{BlBh}{AhBh}{BdBj}{AhBj}6{AhBl}7{BhBl}8{Bj{{Al{Aj}}}}{{{Bn{c}}}c{C`CbCdCfCh}}{Bdc{}}{Bjc{}}{Bj{{Al{D`}}}}3{Bl{{Db{Ah}}}}{ce{}{}}000000{{{Bn{c}}}e{C`CbCdCfCh}{}}``{{cc}{{Dd{c}}}{C`CbCdCfCh}}{{cc}{{Bn{c}}}{C`CbCdCfCh}}{{{Dd{c}}}{{An{e}}}{C`CbCdCfCh}{}}{BdAh}{BhAh}{{BdBd}{{An{Cl}}}}{{BhBh}{{An{Cl}}}}{{BjBj}{{An{Cl}}}}{{BlBl}{{An{Cl}}}}``{C`b}{Blb}<<<<<{c{{h{e}}}{}{}}00000000000{cj{}}00000``````{Df{{An{Bj}}}}{Dh{{An{Bj}}}}{ce{}{}}00000``{{DfBj}b}{{DhBj}b}{Dj{{Dl{Dh}}}}{B`b}``{{B`Cn}A`}{{}{{An{B`}}}}{{}b}{Bjb}{cc{}}00{{DhBjBj}b}3:::{{}Df}{BjB`}{{}Dh}```{c{{h{e}}}{}{}}00000{cj{}}00``{Dnd}99````````````{E`b}{{}Eb}`{{EbEb}Eb}{{EbEb}b}10{EbAj}`21{ce{}{}}000000000{EdEd}{EbEb}{{ce}b{}{}}0{{EbEb}Cl}2{{EbEb}Bf}{{EfEh{Al{Aj}}}b}`{Ej{{El{{Dl{E`}}}}}}:```;{{EdEd}Bf}3``{{Ebc}b{{F`{}{{En{Eb}}}}}}{{EdCn}A`}{{EbCn}A`}0000{cc{}}0000{EfEf}{Aj{{An{Eb}}}}{AjEb}0{{{Al{Aj}}}{{Fb{E`AhAh}}}}{E`E`}{cEb{{F`{}{{En{Eb}}}}}}{{Ebc}bFd}{{EbEb}b}{{E`BhBhEb}b}{{EbEb}Eb}{{EbEb}Bf}{ce{}{}}0000{EbBf}0{{EfEh}b}{{EfEhBl}b}`{E`b}`{{BhBhEdEb}Ef}{{}E`}0{EbEb}`{{EbEb}{{An{Cl}}}}{{E`Ef{An{{Al{Aj}}}}}b}5{{}b}>{{E`Bl}b}``{{EbEbBf}b}```>{{EbEb}b}?==0{E`Ah}{{E`Bl}{{An{D`}}}}{c{{h{e}}}{}{}}000000000{cj{}}0000{{EbEb}Eb}{{EfEh}b}{{EfEhBl}b}````````````{{}Ff}{{FfFf}Ff}{{FfFf}b}10{FfAj}``21{ce{}{}}00000{FfFf}{D`D`}{{ce}b{}{}}0{{FfFf}Cl}3{{FfFf}Bf}89{{}D`}1{D`Bf}{{Ffc}b{{F`{}{{En{Ff}}}}}}{{EhBl}{{An{D`}}}}0{D`Ff}{{FfCn}A`}0000`{cc{}}00{Aj{{An{Ff}}}}{AjFf}0{cFf{{F`{}{{En{Ff}}}}}}{AhEh}{{Ffc}bFd}{{FfFf}b}{{FfFf}Ff}>{ce{}{}}00{FfBf}0>{{EhBlBjFf}b}{{}Eh}{{BjFf}D`}{FfFf}{{FfFf}{{An{Cl}}}}{D`Bj}{D`Bf}:`{{FfFfBf}b}:;:99;{EhAh}{{EhBl}{{An{D`}}}}{{EhBh}{{An{Bd}}}}{{AhAjAh}{{Af{{Al{Aj}}}}}}{Ahc{}}{{AhAj}Bb}{c{{h{e}}}{}{}}00000{cj{}}00{{FfFf}Ff}{{EhBl}b};{{}Ah}{Ahb}0{Bfd}````{ce{}{}}0{{{Dl{c}}}{{Fh{c}}}{}}{cc{}}`2{c{{Dl{c}}}{}}::9```````````{{Ah{Db{Ah}}}Fj}``{{AhAjAh}Fj}0{AjFj}{Fld}{{}Fj}00{{FjFl}Fj}1`````````{{}b}{{{El{Fn}}}b};;```{{}{{An{{El{Fn}}}}}}{{}G`}{{}Ah}{Gb{{El{Fn}}}}{Flb}4>`{ce{}{}}```{{}Gd}````8`{Gfb}`9`7`{c{{h{e}}}{}{}}0{cj{}}`44{cc{}}{AhGf}6```332{{}Gf}```{{Gh{El{Fn}}}b}>8888{Gj{{Dl{Gh}}}}{Gh{{An{{El{Fn}}}}}}?55::{{}Gh}`888877`````{GlGd}<<<<<<<<`{{GlAh}b}{Gn{{Dl{Gl}}}}{Gdb}{H`b};;;;{H`Ah}{ce{}{}}000{Ah{{Fb{AhAh}}}}{{}Gl}{GdH`}`{{}Gd}{{H`c}{}Hb}`{c{{h{e}}}{}{}}0000000{cj{}}000```7777{Hd{{An{{El{Fn}}}}}}`{{}{{An{{El{Fn}}}}}}{{}G`}{{}Ah}{Hf{{Dl{Hd}}}}{cc{}}0{HdGf}`>>{{}Hd}{{}b}{Gfb}98;;;;::````````{ce{}{}}00000`{HhHh}{{ce}b{}{}}{{HhHh}Bf}{{Fn{Al{Aj}}}b}`{{{El{Fn}}}{{El{Fn}}}}:::{HjHh}{HjG`}{HjAh}{FnAh}`{Fn{{Fh{Hj}}}}:::{HjBf}``{{{Al{Aj}}}Fn}````<`{c{{h{e}}}{}{}}00000{cj{}}00``{{}Ah}0{{}b}``00```00`{{}d}0`0``{{AhAhAhAhAh}G`}{ce{}{}}0{cc{}}1```{{G`Ah}b}``887`","c":[],"p":[[1,"unit"],[1,"never"],[5,"Arguments",777],[6,"Result",778],[5,"TypeId",779],[5,"Stdout",29],[1,"str"],[8,"Result",777],[5,"PanicInfo",780],[5,"APP_NAMES",40],[5,"Vec",781],[1,"usize"],[1,"u8"],[1,"slice"],[6,"Option",782],[5,"FrameTracker",203],[5,"String",783],[5,"PhysAddr",82],[1,"bool"],[5,"VirtAddr",82],[5,"PhysPageNum",82],[5,"VirtPageNum",82],[5,"SimpleRange",82],[10,"StepByOne",82],[10,"Copy",784],[10,"PartialEq",785],[10,"PartialOrd",785],[10,"Debug",777],[10,"Clone",786],[6,"Ordering",785],[5,"Formatter",777],[5,"PageTableEntry",389],[1,"array"],[5,"SimpleRangeIterator",82],[10,"FrameAllocator",203],[5,"StackFrameAllocator",203],[5,"FRAME_ALLOCATOR",203],[5,"UPSafeCell",497],[5,"Layout",787],[5,"MemorySet",257],[5,"MapPermission",257],[6,"MapType",257],[5,"MapArea",257],[5,"PageTable",389],[5,"KERNEL_SPACE",257],[5,"Arc",788],[17,"Item"],[10,"IntoIterator",789],[1,"tuple"],[10,"Hasher",790],[5,"PTEFlags",389],[5,"RefMut",791],[1,"isize"],[1,"i32"],[5,"TaskControlBlock",690],[5,"TrapContext",761],[5,"INITPROC",531],[5,"PidHandle",612],[5,"TaskContext",575],[5,"TaskManager",588],[5,"TASK_MANAGER",588],[5,"PidAllocator",612],[5,"PID_ALLOCATOR",612],[5,"KernelStack",612],[10,"Sized",784],[5,"Processor",659],[5,"PROCESSOR",659],[6,"TaskStatus",690],[5,"TaskControlBlockInner",690],[8,"VPNRange",82],[8,"FrameAllocatorImpl",203]],"b":[[137,"impl-From%3CPhysPageNum%3E-for-PhysAddr"],[139,"impl-From%3Cusize%3E-for-PhysAddr"],[141,"impl-From%3CVirtPageNum%3E-for-VirtAddr"],[142,"impl-From%3Cusize%3E-for-VirtAddr"],[143,"impl-From%3CPhysAddr%3E-for-PhysPageNum"],[144,"impl-From%3Cusize%3E-for-PhysPageNum"],[146,"impl-From%3Cusize%3E-for-VirtPageNum"],[148,"impl-From%3CVirtAddr%3E-for-VirtPageNum"],[311,"impl-Octal-for-MapPermission"],[312,"impl-LowerHex-for-MapPermission"],[313,"impl-Binary-for-MapPermission"],[314,"impl-Debug-for-MapPermission"],[315,"impl-UpperHex-for-MapPermission"],[432,"impl-UpperHex-for-PTEFlags"],[433,"impl-Binary-for-PTEFlags"],[434,"impl-LowerHex-for-PTEFlags"],[435,"impl-Debug-for-PTEFlags"],[436,"impl-Octal-for-PTEFlags"]]}]\ +["os",{"t":"CHCCCCCQQHCCCCCCSSSESSEESSSSSFNNNNHNNNNHFONNNNHHHNHNNNFEEFFFFFFFFOCOOOHCCHCCOOHHHHSSFFFFKSISFFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNOONNNNNNNNNOOMNNNNNNNNNNNNNNNNNNNNNNNNFKIFFOMNNNNNNNOOMNNNOONHHHNNNNHNNNMNNOOONNNNNNNNNJJHHHPPFFFGFTTTTONNONNNNNONNNNNNNNNNNNNNNNNNNNONNHHHNNNHHNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNONONNNNONNNHNNHHNHHHNNNNNNNNNNNNNNNNNNNNNNNNNNOTTTFFFTTTTTNNNNNNOONNNNNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNNNNNNNNNNNNNNNNNONNNNNNNNNNHHHNNNNNNNNNNNNHHHHFOCFNNNNONNNNNSSSSSSSSSCCHSSHHHHHHHHHSFFFFFFFOHHNNCOOHHHNHHNONCCOHCOOOHOHOHCHCNNNFNNNNNOOONNNNFFONHNNNNNNHNNNNNONNNNNNFFFFONNNNNNNNNONNNNNNNNNNNNNHNNOHNONNNNNNNNNNNNFFONNNNNOHHHNNNNONNNHHNHNNNNNNHPPFFGPONNNNNNONNNNONNNNNNNNONNNNNOONOOOONONNNNNNNNNSSHHHFCHHOOOHHOHHOHOFNNNNNOOONOONNNO","n":["board","clear_bss","config","console","lang_items","loader","mm","print","println","rust_main","sbi","sync","syscall","task","timer","trap","CLOCK_FREQ","MEMORY_END","MMIO","CLOCK_FREQ","KERNEL_HEAP_SIZE","KERNEL_STACK_SIZE","MEMORY_END","MMIO","PAGE_SIZE","PAGE_SIZE_BITS","TRAMPOLINE","TRAP_CONTEXT","USER_STACK_SIZE","Stdout","borrow","borrow_mut","from","into","print","try_from","try_into","type_id","write_str","panic","APP_NAMES","__private_field","borrow","borrow_mut","deref","from","get_app_data","get_app_data_by_name","get_num_app","into","list_apps","try_from","try_into","type_id","FrameTracker","KERNEL_SPACE","KERNEL_SPACE","KERNEL_SPACE","MapPermission","MemorySet","PageTableEntry","PhysAddr","PhysPageNum","VirtAddr","VirtPageNum","__private_field","address","areas","bits","bits","frame_alloc","frame_allocator","heap_allocator","init","memory_set","page_table","page_table","ppn","remap_test","translated_byte_buffer","translated_refmut","translated_str","PA_WIDTH_SV39","PPN_WIDTH_SV39","PhysAddr","PhysPageNum","SimpleRange","SimpleRangeIterator","StepByOne","VA_WIDTH_SV39","VPNRange","VPN_WIDTH_SV39","VirtAddr","VirtPageNum","aligned","aligned","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","ceil","ceil","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","cmp","cmp","cmp","current","end","eq","eq","eq","eq","floor","floor","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","get_bytes_array","get_end","get_mut","get_mut","get_pte_array","get_start","indexes","into","into","into","into","into","into","into_iter","into_iter","l","l","new","new","next","page_offset","page_offset","partial_cmp","partial_cmp","partial_cmp","partial_cmp","r","r","step","step","to_owned","to_owned","to_owned","to_owned","to_owned","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","FRAME_ALLOCATOR","FrameAllocator","FrameAllocatorImpl","FrameTracker","StackFrameAllocator","__private_field","alloc","alloc","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","current","current","dealloc","dealloc","deref","drop","end","end","fmt","frame_alloc","frame_allocator_test","frame_dealloc","from","from","from","init","init_frame_allocator","into","into","into","new","new","new","ppn","recycled","recycled","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","HEAP_ALLOCATOR","HEAP_SPACE","handle_alloc_error","heap_test","init_heap","Framed","Identical","KERNEL_SPACE","MapArea","MapPermission","MapType","MemorySet","R","U","W","X","__private_field","activate","all","areas","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","complement","contains","copy_data","data_frames","deref","difference","ebss","edata","ekernel","empty","eq","eq","erodata","etext","extend","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from_another","from_bits","from_bits_truncate","from_bits_unchecked","from_elf","from_existed_user","from_iter","hash","insert","insert_framed_area","intersection","intersects","into","into","into","into","into","is_all","is_empty","map","map_one","map_perm","map_trampoline","map_type","new","new_bare","new_kernel","not","page_table","partial_cmp","push","recycle_data_pages","remap_test","remove","remove_area_with_start_vpn","sbss_with_stack","sdata","set","srodata","stext","strampoline","sub","sub_assign","symmetric_difference","to_owned","to_owned","toggle","token","translate","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","union","unmap","unmap_one","vpn_range","A","D","G","PTEFlags","PageTable","PageTableEntry","R","U","V","W","X","all","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","cmp","complement","contains","difference","empty","empty","eq","executable","extend","find_pte","find_pte_create","flags","fmt","fmt","fmt","fmt","fmt","frames","from","from","from","from_bits","from_bits_truncate","from_bits_unchecked","from_iter","from_token","hash","insert","intersection","intersects","into","into","into","is_all","is_empty","is_valid","map","new","new","not","partial_cmp","ppn","readable","remove","root_ppn","set","sub","sub_assign","symmetric_difference","to_owned","to_owned","toggle","token","translate","translate_va","translated_byte_buffer","translated_refmut","translated_str","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","union","unmap","writable","console_getchar","console_putchar","set_timer","shutdown","UPSafeCell","inner","up","UPSafeCell","borrow","borrow_mut","exclusive_access","from","inner","into","new","try_from","try_into","type_id","SYSCALL_EXEC","SYSCALL_EXIT","SYSCALL_FORK","SYSCALL_GETPID","SYSCALL_GET_TIME","SYSCALL_READ","SYSCALL_WAITPID","SYSCALL_WRITE","SYSCALL_YIELD","fs","process","syscall","FD_STDIN","FD_STDOUT","sys_read","sys_write","sys_exec","sys_exit","sys_fork","sys_get_time","sys_getpid","sys_waitpid","sys_yield","IDLE_PID","INITPROC","KernelStack","PidAllocator","PidHandle","Processor","TaskContext","TaskManager","__private_field","add_initproc","add_task","borrow","borrow_mut","context","current","current","current_task","current_trap_cx","current_user_token","deref","exit_current_and_run_next","fetch_task","from","idle_task_cx","into","manager","pid","pid","pid_alloc","processor","ra","ready_queue","recycled","run_tasks","s","schedule","sp","suspend_current_and_run_next","switch","take_current_task","task","try_from","try_into","type_id","TaskContext","borrow","borrow_mut","from","goto_trap_return","into","ra","s","sp","try_from","try_into","type_id","zero_init","TASK_MANAGER","TaskManager","__private_field","add","add_task","borrow","borrow","borrow_mut","borrow_mut","deref","fetch","fetch_task","from","from","into","into","new","ready_queue","try_from","try_from","try_into","try_into","type_id","type_id","KernelStack","PID_ALLOCATOR","PidAllocator","PidHandle","__private_field","alloc","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","current","dealloc","deref","drop","drop","from","from","from","from","get_top","into","into","into","into","kernel_stack_position","new","new","pid","pid_alloc","push_on_top","recycled","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","PROCESSOR","Processor","__private_field","borrow","borrow","borrow_mut","borrow_mut","current","current","current_task","current_trap_cx","current_user_token","deref","from","from","get_idle_task_cx_ptr","idle_task_cx","into","into","new","run_tasks","schedule","take_current","take_current_task","try_from","try_from","try_into","try_into","type_id","type_id","__switch","Ready","Running","TaskControlBlock","TaskControlBlockInner","TaskStatus","Zombie","base_size","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","children","clone","clone_into","eq","exec","exit_code","fork","from","from","from","get_status","get_trap_cx","get_user_token","getpid","inner","inner_exclusive_access","into","into","into","is_zombie","kernel_stack","memory_set","new","parent","pid","task_cx","task_status","to_owned","trap_cx_ppn","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","MSEC_PER_SEC","TICKS_PER_SEC","get_time","get_time_ms","set_next_trigger","TrapContext","context","enable_timer_interrupt","init","kernel_satp","kernel_sp","sepc","set_kernel_trap_entry","set_user_trap_entry","sstatus","trap_from_kernel","trap_handler","trap_handler","trap_return","x","TrapContext","app_init_context","borrow","borrow_mut","from","into","kernel_satp","kernel_sp","sepc","set_sp","sstatus","trap_handler","try_from","try_into","type_id","x"],"q":[[0,"os"],[16,"os::board"],[19,"os::config"],[29,"os::console"],[39,"os::lang_items"],[40,"os::loader"],[54,"os::mm"],[82,"os::mm::address"],[203,"os::mm::frame_allocator"],[252,"os::mm::heap_allocator"],[257,"os::mm::memory_set"],[389,"os::mm::page_table"],[490,"os::sbi"],[494,"os::sync"],[497,"os::sync::up"],[508,"os::syscall"],[520,"os::syscall::fs"],[524,"os::syscall::process"],[531,"os::task"],[575,"os::task::context"],[588,"os::task::manager"],[612,"os::task::pid"],[659,"os::task::processor"],[689,"os::task::switch"],[690,"os::task::task"],[741,"os::timer"],[746,"os::trap"],[761,"os::trap::context"],[777,"core::fmt"],[778,"core::result"],[779,"core::any"],[780,"core::panic::panic_info"],[781,"alloc::vec"],[782,"core::option"],[783,"alloc::string"],[784,"core::marker"],[785,"core::cmp"],[786,"core::clone"],[787,"core::alloc::layout"],[788,"alloc::sync"],[789,"core::iter::traits::collect"],[790,"core::hash"],[791,"core::cell"]],"i":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,6,6,6,6,0,6,6,6,6,0,0,10,10,10,10,10,0,0,0,10,0,10,10,10,0,0,0,0,0,0,0,0,0,0,0,45,0,40,41,32,0,0,0,0,0,0,40,16,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,18,20,34,18,20,21,22,23,34,18,20,21,22,23,18,20,18,20,21,22,23,18,20,21,22,23,18,20,21,22,34,34,18,20,21,22,18,20,18,20,21,22,34,18,18,18,20,20,20,21,21,21,22,22,22,23,21,23,18,21,21,23,22,34,18,20,21,22,23,34,23,70,23,34,23,34,18,20,18,20,21,22,70,23,24,22,18,20,21,22,23,34,18,20,21,22,23,34,18,20,21,22,23,34,18,20,21,22,23,0,0,0,0,0,37,35,36,16,36,37,16,36,37,36,71,35,36,37,16,36,71,16,0,0,0,16,36,37,36,0,16,36,37,35,16,36,16,36,71,16,36,37,16,36,37,16,36,37,0,0,0,0,0,42,42,0,0,0,0,0,41,41,41,41,45,40,41,40,41,41,41,41,41,41,41,41,40,43,45,42,41,40,43,45,42,41,42,41,42,41,41,41,41,43,43,45,41,0,0,0,41,42,41,0,0,41,42,41,41,41,41,41,40,43,45,42,41,43,41,41,41,40,40,41,41,41,40,41,41,40,43,45,42,41,41,41,43,43,43,40,43,43,40,40,41,40,41,40,40,0,41,40,0,0,41,0,0,0,41,41,41,42,41,41,40,40,40,43,45,42,41,40,43,45,42,41,40,43,45,42,41,41,43,43,43,51,51,51,0,0,0,51,51,51,51,51,51,51,51,51,51,51,51,32,51,51,44,51,32,44,51,32,51,32,51,32,51,51,51,51,51,32,51,32,51,44,44,32,51,51,51,51,51,44,44,51,32,51,51,51,51,44,51,51,51,51,44,51,32,51,51,32,44,44,32,51,51,32,32,51,44,51,51,51,51,51,32,51,44,44,44,0,0,0,44,51,32,44,51,32,44,51,32,51,44,32,0,0,0,0,0,38,0,0,38,38,38,38,38,38,38,38,38,38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,57,0,0,57,57,0,62,66,0,0,0,57,0,0,57,66,57,0,0,64,0,0,59,60,62,0,59,0,59,0,0,0,0,57,57,57,0,59,59,59,59,59,59,59,59,59,59,59,59,0,0,61,60,0,60,61,60,61,61,60,0,60,61,60,61,60,60,60,61,60,61,60,61,0,0,0,0,63,62,62,58,64,63,62,58,64,63,62,62,63,58,64,62,58,64,63,64,62,58,64,63,0,62,64,64,0,64,62,62,58,64,63,62,58,64,63,62,58,64,63,0,0,67,66,67,66,67,66,66,0,0,0,67,66,67,66,66,66,67,66,0,0,66,0,66,67,66,67,66,67,0,68,68,0,0,0,68,69,55,69,68,55,69,68,69,68,68,68,55,69,55,55,69,68,69,69,69,55,55,55,55,69,68,69,55,69,55,69,55,69,69,68,69,55,69,68,55,69,68,55,69,68,0,0,0,0,0,0,0,0,0,56,56,56,0,0,56,0,0,56,0,56,0,56,56,56,56,56,56,56,56,56,56,56,56,56,56,56],"f":"`{{}b}```````{{}d}````````````````````{ce{}{}}0{cc{}}1{fb}{c{{h{e}}}{}{}}0{cj{}}{{ln}A`}{Abd}``66{Ad{{Af{n}}}}6{Ah{{Al{Aj}}}}{n{{An{{Al{Aj}}}}}}{{}Ah}:<776````````````````{{}{{An{B`}}}}``=````={{AhAjAh}{{Af{{Al{Aj}}}}}}{Ahc{}}{{AhAj}Bb}````````````{BdBf}{BhBf}{ce{}{}}00000000000{BdBj}{BhBl}{BdBd}{BhBh}{BjBj}{BlBl}{{{Bn{c}}}{{Bn{c}}}{C`CbCdCfChCj}}{{ce}b{}{}}0000{{BdBd}Cl}{{BhBh}Cl}{{BjBj}Cl}{{BlBl}Cl}``{{BdBd}Bf}{{BhBh}Bf}{{BjBj}Bf}{{BlBl}Bf}?>{{BdCn}A`}{{BhCn}A`}{{BjCn}A`}{{BlCn}A`}{cc{}}0{BjBd}{AhBd}{AhBh}3{BlBh}4{BdBj}{AhBj}6{BhBl}{AhBl}8{Bj{{Al{Aj}}}}{{{Bn{c}}}c{C`CbCdCfCh}}{Bdc{}}{Bjc{}}{Bj{{Al{D`}}}}3{Bl{{Db{Ah}}}}{ce{}{}}000000{{{Bn{c}}}e{C`CbCdCfCh}{}}``{{cc}{{Dd{c}}}{C`CbCdCfCh}}{{cc}{{Bn{c}}}{C`CbCdCfCh}}{{{Dd{c}}}{{An{e}}}{C`CbCdCfCh}{}}{BdAh}{BhAh}{{BdBd}{{An{Cl}}}}{{BhBh}{{An{Cl}}}}{{BjBj}{{An{Cl}}}}{{BlBl}{{An{Cl}}}}``{C`b}{Blb}<<<<<{c{{h{e}}}{}{}}00000000000{cj{}}00000``````{Df{{An{Bj}}}}{Dh{{An{Bj}}}}{ce{}{}}00000``{{DfBj}b}{{DhBj}b}{Dj{{Dl{Dh}}}}{B`b}``{{B`Cn}A`}{{}{{An{B`}}}}{{}b}{Bjb}{cc{}}00{{DhBjBj}b}3:::{{}Df}{BjB`}{{}Dh}```{c{{h{e}}}{}{}}00000{cj{}}00``{Dnd}99````````````{E`b}{{}Eb}`{{EbEb}Eb}{{EbEb}b}10{EbAj}`21{ce{}{}}000000000{EdEd}{EbEb}{{ce}b{}{}}0{{EbEb}Cl}2{{EbEb}Bf}{{EfEh{Al{Aj}}}b}`{Ej{{El{{Dl{E`}}}}}}:```;{{EdEd}Bf}3``{{Ebc}b{{F`{}{{En{Eb}}}}}}{{EdCn}A`}{{EbCn}A`}0000{cc{}}0000{EfEf}{Aj{{An{Eb}}}}{AjEb}0{{{Al{Aj}}}{{Fb{E`AhAh}}}}{E`E`}{cEb{{F`{}{{En{Eb}}}}}}{{Ebc}bFd}{{EbEb}b}{{E`BhBhEb}b}{{EbEb}Eb}{{EbEb}Bf}{ce{}{}}0000{EbBf}0{{EfEh}b}{{EfEhBl}b}`{E`b}`{{BhBhEdEb}Ef}{{}E`}0{EbEb}`{{EbEb}{{An{Cl}}}}{{E`Ef{An{{Al{Aj}}}}}b}5{{}b}>{{E`Bl}b}``{{EbEbBf}b}```>{{EbEb}b}?==0{E`Ah}{{E`Bl}{{An{D`}}}}{c{{h{e}}}{}{}}000000000{cj{}}0000{{EbEb}Eb}{{EfEh}b}{{EfEhBl}b}````````````{{}Ff}{{FfFf}Ff}{{FfFf}b}10{FfAj}``21{ce{}{}}00000{FfFf}{D`D`}{{ce}b{}{}}0{{FfFf}Cl}3{{FfFf}Bf}89{{}D`}1{D`Bf}{{Ffc}b{{F`{}{{En{Ff}}}}}}{{EhBl}{{An{D`}}}}0{D`Ff}{{FfCn}A`}0000`{cc{}}00{Aj{{An{Ff}}}}{AjFf}0{cFf{{F`{}{{En{Ff}}}}}}{AhEh}{{Ffc}bFd}{{FfFf}b}{{FfFf}Ff}>{ce{}{}}00{FfBf}0>{{EhBlBjFf}b}{{}Eh}{{BjFf}D`}{FfFf}{{FfFf}{{An{Cl}}}}{D`Bj}{D`Bf}:`{{FfFfBf}b}:;:99;{EhAh}{{EhBl}{{An{D`}}}}{{EhBh}{{An{Bd}}}}{{AhAjAh}{{Af{{Al{Aj}}}}}}{Ahc{}}{{AhAj}Bb}{c{{h{e}}}{}{}}00000{cj{}}00{{FfFf}Ff}{{EhBl}b};{{}Ah}{Ahb}0{Bfd}````{ce{}{}}0{{{Dl{c}}}{{Fh{c}}}{}}{cc{}}`2{c{{Dl{c}}}{}}::9```````````{{Ah{Db{Ah}}}Fj}``{{AhAjAh}Fj}0{AjFj}{Fld}{{}Fj}00{{FjFl}Fj}1`````````{{}b}{{{El{Fn}}}b};;```{{}{{An{{El{Fn}}}}}}{{}G`}{{}Ah}{Gb{{El{Fn}}}}{Flb}4>`{ce{}{}}```{{}Gd}````8`{Gfb}`9`7`{c{{h{e}}}{}{}}0{cj{}}`44{cc{}}{AhGf}6```332{{}Gf}```{{Gh{El{Fn}}}b}>8888{Gj{{Dl{Gh}}}}{Gh{{An{{El{Fn}}}}}}?55::{{}Gh}`888877`````{GlGd}<<<<<<<<`{{GlAh}b}{Gn{{Dl{Gl}}}}{Gdb}{H`b};;;;{H`Ah}{ce{}{}}000{Ah{{Fb{AhAh}}}}{{}Gl}{GdH`}`{{}Gd}{{H`c}{}Hb}`{c{{h{e}}}{}{}}0000000{cj{}}000```7777{Hd{{An{{El{Fn}}}}}}`{{}{{An{{El{Fn}}}}}}{{}G`}{{}Ah}{Hf{{Dl{Hd}}}}{cc{}}0{HdGf}`>>{{}Hd}{{}b}{Gfb}98;;;;::````````{ce{}{}}00000`{HhHh}{{ce}b{}{}}{{HhHh}Bf}{{Fn{Al{Aj}}}b}`{{{El{Fn}}}{{El{Fn}}}}:::{HjHh}{HjG`}{HjAh}{FnAh}`{Fn{{Fh{Hj}}}}:::{HjBf}``{{{Al{Aj}}}Fn}````<`{c{{h{e}}}{}{}}00000{cj{}}00``{{}Ah}0{{}b}``00```00`{{}d}0`0``{{AhAhAhAhAh}G`}{ce{}{}}0{cc{}}1```{{G`Ah}b}``887`","D":"BJh","p":[[1,"unit"],[1,"never"],[5,"Arguments",777],[6,"Result",778],[5,"TypeId",779],[5,"Stdout",29],[1,"str"],[8,"Result",777],[5,"PanicInfo",780],[5,"APP_NAMES",40],[5,"Vec",781],[1,"usize"],[1,"u8"],[1,"slice"],[6,"Option",782],[5,"FrameTracker",203],[5,"String",783],[5,"PhysAddr",82],[1,"bool"],[5,"VirtAddr",82],[5,"PhysPageNum",82],[5,"VirtPageNum",82],[5,"SimpleRange",82],[10,"StepByOne",82],[10,"Copy",784],[10,"PartialEq",785],[10,"PartialOrd",785],[10,"Debug",777],[10,"Clone",786],[6,"Ordering",785],[5,"Formatter",777],[5,"PageTableEntry",389],[1,"array"],[5,"SimpleRangeIterator",82],[10,"FrameAllocator",203],[5,"StackFrameAllocator",203],[5,"FRAME_ALLOCATOR",203],[5,"UPSafeCell",497],[5,"Layout",787],[5,"MemorySet",257],[5,"MapPermission",257],[6,"MapType",257],[5,"MapArea",257],[5,"PageTable",389],[5,"KERNEL_SPACE",257],[5,"Arc",788],[17,"Item"],[10,"IntoIterator",789],[1,"tuple"],[10,"Hasher",790],[5,"PTEFlags",389],[5,"RefMut",791],[1,"isize"],[1,"i32"],[5,"TaskControlBlock",690],[5,"TrapContext",761],[5,"INITPROC",531],[5,"PidHandle",612],[5,"TaskContext",575],[5,"TaskManager",588],[5,"TASK_MANAGER",588],[5,"PidAllocator",612],[5,"PID_ALLOCATOR",612],[5,"KernelStack",612],[10,"Sized",784],[5,"Processor",659],[5,"PROCESSOR",659],[6,"TaskStatus",690],[5,"TaskControlBlockInner",690],[8,"VPNRange",82],[8,"FrameAllocatorImpl",203]],"r":[[19,16],[22,16],[23,16],[54,203],[55,257],[56,257],[57,257],[58,257],[59,257],[60,389],[61,82],[62,82],[63,82],[64,82],[70,203],[78,257],[79,389],[80,389],[81,389],[494,497],[533,612],[534,612],[535,612],[536,659],[537,575],[538,588],[541,588],[547,659],[548,659],[549,659],[552,588],[559,612],[564,659],[566,659],[570,659],[746,761]],"b":[[138,"impl-From%3CPhysPageNum%3E-for-PhysAddr"],[139,"impl-From%3Cusize%3E-for-PhysAddr"],[140,"impl-From%3Cusize%3E-for-VirtAddr"],[142,"impl-From%3CVirtPageNum%3E-for-VirtAddr"],[144,"impl-From%3CPhysAddr%3E-for-PhysPageNum"],[145,"impl-From%3Cusize%3E-for-PhysPageNum"],[147,"impl-From%3CVirtAddr%3E-for-VirtPageNum"],[148,"impl-From%3Cusize%3E-for-VirtPageNum"],[311,"impl-UpperHex-for-MapPermission"],[312,"impl-Octal-for-MapPermission"],[313,"impl-LowerHex-for-MapPermission"],[314,"impl-Binary-for-MapPermission"],[315,"impl-Debug-for-MapPermission"],[432,"impl-UpperHex-for-PTEFlags"],[433,"impl-Octal-for-PTEFlags"],[434,"impl-LowerHex-for-PTEFlags"],[435,"impl-Binary-for-PTEFlags"],[436,"impl-Debug-for-PTEFlags"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAALUBXgARAA8AIwAFACoAAwA0AAIAOAABAEIAAABEAAEATQABAFQAAABZAAEAXAAAAGEACwBvABMAhQADAIsAAgCPAAAAkQABAJQAAQCXAAEAmgAAAJwAAACkAAYArQAeAM0AAQDRABEA6QAAAO4AAADwAAwAAAEAAAIBAQANAQAAEAEAABYBAAAZAQ4AKwEBAC4BAgAyAQoAQgEAAEgBAQBVAQIAWQEBAF4BAgBlAQEAaAECAG4BAQBzAQ4AgwEHAIwBBACXAQAAmwEKAKsBAACtAQIAsQEFAL0BAAC/AQAAyQEBAM0BAADRAQAA1gEBANkBAgDfAQgA6QEAAPMBAQD6AQsABwIAAAkCCAATAgAAHAIAAB8CAQAiAgAAJwIAAC8CAAAzAgEAPQICAEECAQBJAgIATQIAAE8CAABSAgQAXgIGAGYCAABpAgAAawIIAHUCAgCEAgAAhwINAJYCBACgAgAArAIaAMoCBQDTAhQA8gIBAPwCAQAGAwIA"}]\ ]')); if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; else if (window.initSearch) window.initSearch(searchIndex); diff --git a/ch5/search.desc/os/os-desc-0-.js b/ch5/search.desc/os/os-desc-0-.js new file mode 100644 index 00000000..9f3a6a74 --- /dev/null +++ b/ch5/search.desc/os/os-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("os", 0, "The main module and entrypoint\nConstants used in rCore for qemu\nclear BSS segment\nConstants used in rCore\nSBI console driver, for text output\nThe panic handler\nLoading user applications into memory\nMemory management implementation\nprint string macro\nprintln string macro\nthe rust entry-point of os\nSBI call wrappers\nSynchronization and interior mutability primitives\nImplementation of syscalls\nTask management implementation\nRISC-V timer-related functionality\nTrap handling functionality\nReturns the argument unchanged.\nCalls U::from(self).\nAll of app’s name\nReturns the argument unchanged.\nget applications data\nget app data from name\nget app number\nCalls U::from(self).\nlist all apps\nmanage a frame which has the same lifecycle as the tracker\na memory set instance through lazy_static! managing kernel …\nmap permission corresponding to that in pte: R W X U\nmemory set structure, controls virtual-memory space\npage table entry structure\nphysical address\nphysical page number\nvirtual address\nvirtual page number\nImplementation of physical and virtual address and page …\nPTE\nallocate a frame\nImplementation of FrameAllocator which controls all the …\nThe global allocator\ninitiate heap allocator, frame allocator and kernel space\nImplementation of MapArea and MemorySet.\nImplementation of PageTableEntry and PageTable.\nCheck PageTable running correctly\ntranslate a pointer to a mutable u8 Vec through page table\ntranslate a generic through page table and return a …\ntranslate a pointer to a mutable u8 Vec end with \\0 …\nphysical address\nphysical address\nphysical page number\na simple range structure for type T\niterator for the simple range structure\na simple range structure for virtual page number\nvirtual address\nvirtual page number\nCheck page aligned\nCheck page aligned\nPhysAddr->PhysPageNum\nVirtAddr->VirtPageNum\nPhysAddr->PhysPageNum\nVirtAddr->VirtPageNum\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet mutable reference to PhysAddr value\nGet PageTableEntry on PhysPageNum\nReturn VPN 3 level index\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nGet page offset\nGet page offset\nframe allocator instance through lazy_static!\nmanage a frame which has the same lifecycle as the tracker\nan implementation for frame allocator\nallocate a frame\na simple test for frame allocator\ndeallocate a frame\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\ninitiate the frame allocator using ekernel and MEMORY_END\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCreate an empty FrameTracker\nheap allocator instance\nheap space ([u8; KERNEL_HEAP_SIZE])\npanic when heap allocation error occurs\ninitiate heap allocator\na memory set instance through lazy_static! managing kernel …\nmap area structure, controls a contiguous piece of virtual …\nmap permission corresponding to that in pte: R W X U\nmap type for memory set: identical or framed\nmemory set structure, controls virtual-memory space\nReadable\nAccessible in U mode\nWritable\nExcutable\nRefresh TLB with sfence.vma\nReturns the set containing all flags.\nReturns the intersection between the two sets of flags.\nDisables all flags disabled in the set.\nReturns the union of the two sets of flags.\nAdds the set of flags.\nReturns the raw value of the flags currently stored.\nReturns the left flags, but with all the right flags …\nToggles the set of flags.\nReturns the complement of this set of flags.\nReturns true if all of the flags in other are contained …\ndata: start-aligned but maybe with shorter length assume …\nReturns the difference between the flags in self and other.\nReturns an empty set of flags.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConvert from underlying bit representation, unless that …\nConvert from underlying bit representation, dropping any …\nConvert from underlying bit representation, preserving all …\nInclude sections in elf and trampoline and TrapContext and …\nClone a same MemorySet\nInserts the specified flags in-place.\nAssume that no conflicts.\nReturns the intersection between the flags in self and …\nReturns true if there are flags common to both self and …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns true if all flags are currently set.\nReturns true if no flags are currently stored.\nMention that trampoline is not collected by areas.\nCreate an empty MemorySet\nWithout kernel stacks.\nReturns the complement of this set of flags.\nRemove all MapArea\nCheck PageTable running correctly\nRemoves the specified flags in-place.\nRemove MapArea that starts with start_vpn\nInserts or removes the specified flags depending on the …\nReturns the set difference of the two sets of flags.\nDisables all flags enabled in the set.\nReturns the symmetric difference between the flags in self …\nToggles the specified flags in-place.\nGet pagetable root_ppn\nTranslate throuth pagetable\nReturns the union of between the flags in self and other.\npage table entry structure\nReturns the set containing all flags.\nReturns the intersection between the two sets of flags.\nDisables all flags disabled in the set.\nReturns the union of the two sets of flags.\nAdds the set of flags.\nReturns the raw value of the flags currently stored.\nPTE\nReturns the left flags, but with all the right flags …\nToggles the set of flags.\nReturns the complement of this set of flags.\nReturns true if all of the flags in other are contained …\nReturns the difference between the flags in self and other.\nReturns an empty set of flags.\nReturn an empty PTE\nCheck PTE executable\nReturn 10bit flag\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConvert from underlying bit representation, unless that …\nConvert from underlying bit representation, dropping any …\nConvert from underlying bit representation, preserving all …\nTemporarily used to get arguments from user space.\nInserts the specified flags in-place.\nReturns the intersection between the flags in self and …\nReturns true if there are flags common to both self and …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturns true if all flags are currently set.\nReturns true if no flags are currently stored.\nCheck PTE valid\nCreate a PTE from ppn\nReturns the complement of this set of flags.\nReturn 44bit ppn\nCheck PTE readable\nRemoves the specified flags in-place.\nInserts or removes the specified flags depending on the …\nReturns the set difference of the two sets of flags.\nDisables all flags enabled in the set.\nReturns the symmetric difference between the flags in self …\nToggles the specified flags in-place.\ntranslate a pointer to a mutable u8 Vec through page table\ntranslate a generic through page table and return a …\ntranslate a pointer to a mutable u8 Vec end with \\0 …\nReturns the union of between the flags in self and other.\nCheck PTE writable\nuse sbi call to getchar from console (qemu uart handler)\nuse sbi call to putchar in console (qemu uart handler)\nuse sbi call to set timer\nuse sbi call to shutdown the kernel\nWrap a static data structure inside it so that we are able …\ninner data\nUniprocessor interior mutability primitives\nWrap a static data structure inside it so that we are able …\nExclusive access inner data in UPSafeCell. Panic if the …\nReturns the argument unchanged.\ninner data\nCalls U::from(self).\nUser is responsible to guarantee that inner struct is only …\nFile and filesystem-related syscalls\nhandle syscall exception with syscall_id and other …\nIf there is not a child process whose pid is same as …\npid of usertests app in make run TEST=1\nGloble process that init user shell\nKernelstack for app\nPid Allocator struct\nBind pid lifetime to PidHandle\nProcessor management structure\ntask context structure containing some registers\nA array of TaskControlBlock that is thread-safe\nAdd init process to the manager\nInterface offered to add task\nImplementation of TaskContext\nThe task currently executing on the current processor\nGet running task\nGet the mutable reference to trap context of current task\nGet token of the address space of current task\nExit the current ‘Running’ task and run the next task …\nInterface offered to pop the first task\nReturns the argument unchanged.\nThe basic control flow of each core, helping to select and …\nCalls U::from(self).\nImplementation of TaskManager\nImplementation of PidAllocator\nAllocate a pid from PID_ALLOCATOR\nImplementation of Processor and Intersection of control …\nreturn address ( e.g. __restore ) of __switch ASM function\nThe main part of process execution and scheduling Loop …\ns0-11 register, callee saved\nReturn to idle control flow for new scheduling\nkernel stack pointer of app\nSuspend the current ‘Running’ task and run the next …\nWrap switch.S as a function\nTake the current task,leaving a None in its place\nImplementation of TaskControlBlock\ntask context structure containing some registers\nReturns the argument unchanged.\nset Task Context{__restore ASM funciton: trap_return, sp: …\nCalls U::from(self).\nreturn address ( e.g. __restore ) of __switch ASM function\ns0-11 register, callee saved\nkernel stack pointer of app\ninit task context\nA array of TaskControlBlock that is thread-safe\nAdd a task to TaskManager\nInterface offered to add task\nRemove the first task and return it,or None if TaskManager …\nInterface offered to pop the first task\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCreat an empty TaskManager\nKernelstack for app\nPid Allocator struct\nBind pid lifetime to PidHandle\nAllocate a pid\nRecycle a pid\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet the value on the top of kernelstack\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nReturn (bottom, top) of a kernel stack in kernel space.\nCreate an empty PidAllocator\nCreate a kernelstack from pid\nAllocate a pid from PID_ALLOCATOR\nPush a value on top of kernelstack\nProcessor management structure\nGet current task in cloning semanteme\nThe task currently executing on the current processor\nGet running task\nGet the mutable reference to trap context of current task\nGet token of the address space of current task\nReturns the argument unchanged.\nReturns the argument unchanged.\nGet mutable reference to idle_task_cx\nThe basic control flow of each core, helping to select and …\nCalls U::from(self).\nCalls U::from(self).\nCreate an empty Processor\nThe main part of process execution and scheduling Loop …\nReturn to idle control flow for new scheduling\nGet current task in moving semanteme\nTake the current task,leaving a None in its place\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nget current time\nget current time in microseconds\nset the next timer interrupt\ntrap context structure containing sstatus, sepc and …\nImplementation of TrapContext\nenable timer interrupt in sie CSR\ninitialize CSR stvec as the entry of __alltraps\nAddr of Page Table\nkernel stack\nCSR sepc\nCSR sstatus \nUnimplement: traps/interrupts/exceptions from kernel mode …\nhandle an interrupt, exception, or system call from user …\nAddr of trap_handler function\nset the new addr of __restore asm function in TRAMPOLINE …\ngeneral regs[0..31]\ntrap context structure containing sstatus, sepc and …\ninit app context\nReturns the argument unchanged.\nCalls U::from(self).\nAddr of Page Table\nkernel stack\nCSR sepc\nset stack pointer to x_2 reg (sp)\nCSR sstatus \nAddr of trap_handler function\ngeneral regs[0..31]") \ No newline at end of file diff --git a/ch5/settings.html b/ch5/settings.html index 63ab9477..1a783e5d 100644 --- a/ch5/settings.html +++ b/ch5/settings.html @@ -1,2 +1 @@ -Settings -

Rustdoc settings

Back
\ No newline at end of file +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/ch5/src/os/boards/qemu.rs.html b/ch5/src/os/boards/qemu.rs.html index 6b566483..86b41343 100644 --- a/ch5/src/os/boards/qemu.rs.html +++ b/ch5/src/os/boards/qemu.rs.html @@ -1,6 +1,4 @@ -qemu.rs - source -
1
+qemu.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/config.rs.html b/ch5/src/os/config.rs.html
index 583ad497..4906fb48 100644
--- a/ch5/src/os/config.rs.html
+++ b/ch5/src/os/config.rs.html
@@ -1,6 +1,4 @@
-config.rs - source
-    
1
+config.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/console.rs.html b/ch5/src/os/console.rs.html
index 50aad270..5b0bc5f7 100644
--- a/ch5/src/os/console.rs.html
+++ b/ch5/src/os/console.rs.html
@@ -1,6 +1,4 @@
-console.rs - source
-    
1
+console.rs - source
1
 2
 3
 4
@@ -55,7 +53,7 @@
 
 #[macro_export]
 /// print string macro
-macro_rules! print {
+macro_rules! print {
     ($fmt: literal $(, $($arg: tt)+)?) => {
         $crate::console::print(format_args!($fmt $(, $($arg)+)?));
     }
@@ -63,7 +61,7 @@
 
 #[macro_export]
 /// println string macro
-macro_rules! println {
+macro_rules! println {
     ($fmt: literal $(, $($arg: tt)+)?) => {
         $crate::console::print(format_args!(concat!($fmt, "\n") $(, $($arg)+)?));
     }
diff --git a/ch5/src/os/lang_items.rs.html b/ch5/src/os/lang_items.rs.html
index 30a64341..36fd6d49 100644
--- a/ch5/src/os/lang_items.rs.html
+++ b/ch5/src/os/lang_items.rs.html
@@ -1,6 +1,4 @@
-lang_items.rs - source
-    
1
+lang_items.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/loader.rs.html b/ch5/src/os/loader.rs.html
index f9b03f34..9745baa9 100644
--- a/ch5/src/os/loader.rs.html
+++ b/ch5/src/os/loader.rs.html
@@ -1,6 +1,4 @@
-loader.rs - source
-    
1
+loader.rs - source
1
 2
 3
 4
@@ -99,7 +97,7 @@
     }
 }
 
-lazy_static! {
+lazy_static! {
     ///All of app's name
     static ref APP_NAMES: Vec<&'static str> = {
         let num_app = get_num_app();
diff --git a/ch5/src/os/main.rs.html b/ch5/src/os/main.rs.html
index d667ab9f..45aae72f 100644
--- a/ch5/src/os/main.rs.html
+++ b/ch5/src/os/main.rs.html
@@ -1,6 +1,4 @@
-main.rs - source
-    
1
+main.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/mm/address.rs.html b/ch5/src/os/mm/address.rs.html
index 5219d459..90cd9772 100644
--- a/ch5/src/os/mm/address.rs.html
+++ b/ch5/src/os/mm/address.rs.html
@@ -1,6 +1,4 @@
-address.rs - source
-    
1
+address.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/mm/frame_allocator.rs.html b/ch5/src/os/mm/frame_allocator.rs.html
index 03976ae9..c51f46a9 100644
--- a/ch5/src/os/mm/frame_allocator.rs.html
+++ b/ch5/src/os/mm/frame_allocator.rs.html
@@ -1,6 +1,4 @@
-frame_allocator.rs - source
-    
1
+frame_allocator.rs - source
1
 2
 3
 4
@@ -223,7 +221,7 @@
 
 type FrameAllocatorImpl = StackFrameAllocator;
 
-lazy_static! {
+lazy_static! {
     /// frame allocator instance through lazy_static!
     pub static ref FRAME_ALLOCATOR: UPSafeCell<FrameAllocatorImpl> =
         unsafe { UPSafeCell::new(FrameAllocatorImpl::new()) };
diff --git a/ch5/src/os/mm/heap_allocator.rs.html b/ch5/src/os/mm/heap_allocator.rs.html
index 5e7d90ef..22b8084d 100644
--- a/ch5/src/os/mm/heap_allocator.rs.html
+++ b/ch5/src/os/mm/heap_allocator.rs.html
@@ -1,6 +1,4 @@
-heap_allocator.rs - source
-    
1
+heap_allocator.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/mm/memory_set.rs.html b/ch5/src/os/mm/memory_set.rs.html
index 529d9834..42805648 100644
--- a/ch5/src/os/mm/memory_set.rs.html
+++ b/ch5/src/os/mm/memory_set.rs.html
@@ -1,6 +1,4 @@
-memory_set.rs - source
-    
1
+memory_set.rs - source
1
 2
 3
 4
@@ -431,7 +429,7 @@
     fn strampoline();
 }
 
-lazy_static! {
+lazy_static! {
     /// a memory set instance through lazy_static! managing kernel space
     pub static ref KERNEL_SPACE: Arc<UPSafeCell<MemorySet>> =
         Arc::new(unsafe { UPSafeCell::new(MemorySet::new_kernel()) });
@@ -770,7 +768,7 @@
     Framed,
 }
 
-bitflags! {
+bitflags! {
     /// map permission corresponding to that in pte: `R W X U`
     pub struct MapPermission: u8 {
         ///Readable
diff --git a/ch5/src/os/mm/mod.rs.html b/ch5/src/os/mm/mod.rs.html
index 05b26cb7..9bdabdb8 100644
--- a/ch5/src/os/mm/mod.rs.html
+++ b/ch5/src/os/mm/mod.rs.html
@@ -1,6 +1,4 @@
-mod.rs - source
-    
1
+mod.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/mm/page_table.rs.html b/ch5/src/os/mm/page_table.rs.html
index ecec4550..cb534eba 100644
--- a/ch5/src/os/mm/page_table.rs.html
+++ b/ch5/src/os/mm/page_table.rs.html
@@ -1,6 +1,4 @@
-page_table.rs - source
-    
1
+page_table.rs - source
1
 2
 3
 4
@@ -210,7 +208,7 @@
 use alloc::vec::Vec;
 use bitflags::*;
 
-bitflags! {
+bitflags! {
     pub struct PTEFlags: u8 {
         const V = 1 << 0;
         const R = 1 << 1;
diff --git a/ch5/src/os/sbi.rs.html b/ch5/src/os/sbi.rs.html
index 226f8934..701fb214 100644
--- a/ch5/src/os/sbi.rs.html
+++ b/ch5/src/os/sbi.rs.html
@@ -1,6 +1,4 @@
-sbi.rs - source
-    
1
+sbi.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/sync/mod.rs.html b/ch5/src/os/sync/mod.rs.html
index 1475e089..3a94884c 100644
--- a/ch5/src/os/sync/mod.rs.html
+++ b/ch5/src/os/sync/mod.rs.html
@@ -1,6 +1,4 @@
-mod.rs - source
-    
1
+mod.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/sync/up.rs.html b/ch5/src/os/sync/up.rs.html
index c652ab4d..856960c6 100644
--- a/ch5/src/os/sync/up.rs.html
+++ b/ch5/src/os/sync/up.rs.html
@@ -1,6 +1,4 @@
-up.rs - source
-    
1
+up.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/syscall/fs.rs.html b/ch5/src/os/syscall/fs.rs.html
index 67f9e453..ca7f73f0 100644
--- a/ch5/src/os/syscall/fs.rs.html
+++ b/ch5/src/os/syscall/fs.rs.html
@@ -1,6 +1,4 @@
-fs.rs - source
-    
1
+fs.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/syscall/mod.rs.html b/ch5/src/os/syscall/mod.rs.html
index 0a2da868..7e489f03 100644
--- a/ch5/src/os/syscall/mod.rs.html
+++ b/ch5/src/os/syscall/mod.rs.html
@@ -1,6 +1,4 @@
-mod.rs - source
-    
1
+mod.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/syscall/process.rs.html b/ch5/src/os/syscall/process.rs.html
index 28c46d4a..bbf462b5 100644
--- a/ch5/src/os/syscall/process.rs.html
+++ b/ch5/src/os/syscall/process.rs.html
@@ -1,6 +1,4 @@
-process.rs - source
-    
1
+process.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/task/context.rs.html b/ch5/src/os/task/context.rs.html
index c76b8997..ba13b14a 100644
--- a/ch5/src/os/task/context.rs.html
+++ b/ch5/src/os/task/context.rs.html
@@ -1,6 +1,4 @@
-context.rs - source
-    
1
+context.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/task/manager.rs.html b/ch5/src/os/task/manager.rs.html
index cb95ad41..9ab83d48 100644
--- a/ch5/src/os/task/manager.rs.html
+++ b/ch5/src/os/task/manager.rs.html
@@ -1,6 +1,4 @@
-manager.rs - source
-    
1
+manager.rs - source
1
 2
 3
 4
@@ -70,7 +68,7 @@
     }
 }
 
-lazy_static! {
+lazy_static! {
     pub static ref TASK_MANAGER: UPSafeCell<TaskManager> =
         unsafe { UPSafeCell::new(TaskManager::new()) };
 }
diff --git a/ch5/src/os/task/mod.rs.html b/ch5/src/os/task/mod.rs.html
index c356a374..c74af8a8 100644
--- a/ch5/src/os/task/mod.rs.html
+++ b/ch5/src/os/task/mod.rs.html
@@ -1,6 +1,4 @@
-mod.rs - source
-    
1
+mod.rs - source
1
 2
 3
 4
@@ -232,7 +230,7 @@
     schedule(&mut _unused as *mut _);
 }
 
-lazy_static! {
+lazy_static! {
     ///Globle process that init user shell
     pub static ref INITPROC: Arc<TaskControlBlock> = Arc::new(TaskControlBlock::new(
         get_app_data_by_name("initproc").unwrap()
diff --git a/ch5/src/os/task/pid.rs.html b/ch5/src/os/task/pid.rs.html
index b18cda4b..c821cb22 100644
--- a/ch5/src/os/task/pid.rs.html
+++ b/ch5/src/os/task/pid.rs.html
@@ -1,6 +1,4 @@
-pid.rs - source
-    
1
+pid.rs - source
1
 2
 3
 4
@@ -152,7 +150,7 @@
     }
 }
 
-lazy_static! {
+lazy_static! {
     pub static ref PID_ALLOCATOR: UPSafeCell<PidAllocator> =
         unsafe { UPSafeCell::new(PidAllocator::new()) };
 }
diff --git a/ch5/src/os/task/processor.rs.html b/ch5/src/os/task/processor.rs.html
index e37156b7..be7a9f11 100644
--- a/ch5/src/os/task/processor.rs.html
+++ b/ch5/src/os/task/processor.rs.html
@@ -1,6 +1,4 @@
-processor.rs - source
-    
1
+processor.rs - source
1
 2
 3
 4
@@ -131,7 +129,7 @@
     }
 }
 
-lazy_static! {
+lazy_static! {
     pub static ref PROCESSOR: UPSafeCell<Processor> = unsafe { UPSafeCell::new(Processor::new()) };
 }
 ///The main part of process execution and scheduling
diff --git a/ch5/src/os/task/switch.rs.html b/ch5/src/os/task/switch.rs.html
index 08120a8e..88ddec20 100644
--- a/ch5/src/os/task/switch.rs.html
+++ b/ch5/src/os/task/switch.rs.html
@@ -1,6 +1,4 @@
-switch.rs - source
-    
1
+switch.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/task/task.rs.html b/ch5/src/os/task/task.rs.html
index ac75657b..688a948f 100644
--- a/ch5/src/os/task/task.rs.html
+++ b/ch5/src/os/task/task.rs.html
@@ -1,6 +1,4 @@
-task.rs - source
-    
1
+task.rs - source
1
 2
 3
 4
@@ -171,6 +169,7 @@
 169
 170
 171
+172
 
//!Implementation of [`TaskControlBlock`]
 use super::TaskContext;
 use super::{pid_alloc, KernelStack, PidHandle};
@@ -192,7 +191,8 @@
 
 pub struct TaskControlBlockInner {
     pub trap_cx_ppn: PhysPageNum,
-    pub base_size: usize,
+    #[allow(unused)]
+    pub base_size: usize,
     pub task_cx: TaskContext,
     pub task_status: TaskStatus,
     pub memory_set: MemorySet,
diff --git a/ch5/src/os/timer.rs.html b/ch5/src/os/timer.rs.html
index 640a212c..916e0ce3 100644
--- a/ch5/src/os/timer.rs.html
+++ b/ch5/src/os/timer.rs.html
@@ -1,6 +1,4 @@
-timer.rs - source
-    
1
+timer.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/trap/context.rs.html b/ch5/src/os/trap/context.rs.html
index a3338fdc..05378d3b 100644
--- a/ch5/src/os/trap/context.rs.html
+++ b/ch5/src/os/trap/context.rs.html
@@ -1,6 +1,4 @@
-context.rs - source
-    
1
+context.rs - source
1
 2
 3
 4
diff --git a/ch5/src/os/trap/mod.rs.html b/ch5/src/os/trap/mod.rs.html
index dd84c03d..a1a1a02e 100644
--- a/ch5/src/os/trap/mod.rs.html
+++ b/ch5/src/os/trap/mod.rs.html
@@ -1,6 +1,4 @@
-mod.rs - source
-    
1
+mod.rs - source
1
 2
 3
 4
diff --git a/ch5/static.files/clipboard-7571035ce49a181d.svg b/ch5/static.files/clipboard-7571035ce49a181d.svg
deleted file mode 100644
index 8adbd996..00000000
--- a/ch5/static.files/clipboard-7571035ce49a181d.svg
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/ch5/static.files/favicon-16x16-8b506e7a72182f1c.png b/ch5/static.files/favicon-16x16-8b506e7a72182f1c.png
deleted file mode 100644
index ea4b45cae1618e6e20e6d61897da953f34b66b30..0000000000000000000000000000000000000000
GIT binary patch
literal 0
HcmV?d00001

literal 715
zcmeAS@N?(olHy`uVBq!ia0vp^0wB!60wlNoGJgf6SkfJR9T^xl_H+M9WCijSl0AZa
z85pY67#JE_7#My5g&JNkFq9fFFuY1&V6d9Oz#v{QXIG#NP=YDR+ueoXe|!I#{XiaP
zfk$L9P|ym58ULAS1_A}yOFVsD*`G1;@(QxEEoEaloaX$3oUhmn3B1b>^
zXS8u>Ub4$r*u2F1FEiJ>rQJ&x%nC}Q!>*kacg*^JAVaGgCxj?;QX|b^2DN4hVt@qz0ADq;^f4FRK5J7^x5xhq=1UT
zt3o15f)dLW3X1a6GILTDN-7Id6*3D-k{K8(<~;ty!%-Nfp>fLp^cl~mK@7~w+0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url){const script=document.createElement("script");script.src=url;document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"));loadScript(resourcePath("search-index",".js"))}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}})}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","));for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px")}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ -the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ - restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ - enum, trait, type, macro, \ - and const.","Search functions by type signature (e.g., vec -> usize or \ - -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ - your request: \"string\"","Look for functions that accept or return \ - slices and \ - arrays by writing \ - square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px")},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.children[0].style.display="none";let tmp;if(but.childNodes.length<2){tmp=document.createTextNode("✓");but.appendChild(tmp)}else{onEachLazy(but.childNodes,e=>{if(e.nodeType===Node.TEXT_NODE){tmp=e;return true}});tmp.textContent="✓"}if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){tmp.textContent="";reset_button_timeout=null;but.children[0].style.display=""}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/ch5/static.files/main-20a3ad099b048cf2.js b/ch5/static.files/main-20a3ad099b048cf2.js new file mode 100644 index 00000000..133116e4 --- /dev/null +++ b/ch5/static.files/main-20a3ad099b048cf2.js @@ -0,0 +1,11 @@ +"use strict";window.RUSTDOC_TOOLTIP_HOVER_MS=300;window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS=450;function resourcePath(basename,extension){return getVar("root-path")+basename+getVar("resource-suffix")+extension}function hideMain(){addClass(document.getElementById(MAIN_ID),"hidden")}function showMain(){removeClass(document.getElementById(MAIN_ID),"hidden")}function blurHandler(event,parentElem,hideCallback){if(!parentElem.contains(document.activeElement)&&!parentElem.contains(event.relatedTarget)){hideCallback()}}window.rootPath=getVar("root-path");window.currentCrate=getVar("current-crate");function setMobileTopbar(){const mobileTopbar=document.querySelector(".mobile-topbar");const locationTitle=document.querySelector(".sidebar h2.location");if(mobileTopbar){const mobileTitle=document.createElement("h2");mobileTitle.className="location";if(hasClass(document.querySelector(".rustdoc"),"crate")){mobileTitle.innerHTML=`Crate ${window.currentCrate}`}else if(locationTitle){mobileTitle.innerHTML=locationTitle.innerHTML}mobileTopbar.appendChild(mobileTitle)}}function getVirtualKey(ev){if("key"in ev&&typeof ev.key!=="undefined"){return ev.key}const c=ev.charCode||ev.keyCode;if(c===27){return"Escape"}return String.fromCharCode(c)}const MAIN_ID="main-content";const SETTINGS_BUTTON_ID="settings-menu";const ALTERNATIVE_DISPLAY_ID="alternative-display";const NOT_DISPLAYED_ID="not-displayed";const HELP_BUTTON_ID="help-button";function getSettingsButton(){return document.getElementById(SETTINGS_BUTTON_ID)}function getHelpButton(){return document.getElementById(HELP_BUTTON_ID)}function getNakedUrl(){return window.location.href.split("?")[0].split("#")[0]}function insertAfter(newNode,referenceNode){referenceNode.parentNode.insertBefore(newNode,referenceNode.nextSibling)}function getOrCreateSection(id,classes){let el=document.getElementById(id);if(!el){el=document.createElement("section");el.id=id;el.className=classes;insertAfter(el,document.getElementById(MAIN_ID))}return el}function getAlternativeDisplayElem(){return getOrCreateSection(ALTERNATIVE_DISPLAY_ID,"content hidden")}function getNotDisplayedElem(){return getOrCreateSection(NOT_DISPLAYED_ID,"hidden")}function switchDisplayedElement(elemToDisplay){const el=getAlternativeDisplayElem();if(el.children.length>0){getNotDisplayedElem().appendChild(el.firstElementChild)}if(elemToDisplay===null){addClass(el,"hidden");showMain();return}el.appendChild(elemToDisplay);hideMain();removeClass(el,"hidden")}function browserSupportsHistoryApi(){return window.history&&typeof window.history.pushState==="function"}function preLoadCss(cssUrl){const link=document.createElement("link");link.href=cssUrl;link.rel="preload";link.as="style";document.getElementsByTagName("head")[0].appendChild(link)}(function(){const isHelpPage=window.location.pathname.endsWith("/help.html");function loadScript(url,errorCallback){const script=document.createElement("script");script.src=url;if(errorCallback!==undefined){script.onerror=errorCallback}document.head.append(script)}getSettingsButton().onclick=event=>{if(event.ctrlKey||event.altKey||event.metaKey){return}window.hideAllModals(false);addClass(getSettingsButton(),"rotate");event.preventDefault();loadScript(getVar("static-root-path")+getVar("settings-js"));setTimeout(()=>{const themes=getVar("themes").split(",");for(const theme of themes){if(theme!==""){preLoadCss(getVar("root-path")+theme+".css")}}},0)};window.searchState={loadingText:"Loading search results...",input:document.getElementsByClassName("search-input")[0],outputElement:()=>{let el=document.getElementById("search");if(!el){el=document.createElement("section");el.id="search";getNotDisplayedElem().appendChild(el)}return el},title:document.title,titleBeforeSearch:document.title,timeout:null,currentTab:0,focusedByTab:[null,null,null],clearInputTimeout:()=>{if(searchState.timeout!==null){clearTimeout(searchState.timeout);searchState.timeout=null}},isDisplayed:()=>searchState.outputElement().parentElement.id===ALTERNATIVE_DISPLAY_ID,focus:()=>{searchState.input.focus()},defocus:()=>{searchState.input.blur()},showResults:search=>{if(search===null||typeof search==="undefined"){search=searchState.outputElement()}switchDisplayedElement(search);searchState.mouseMovedAfterSearch=false;document.title=searchState.title},removeQueryParameters:()=>{document.title=searchState.titleBeforeSearch;if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.hash)}},hideResults:()=>{switchDisplayedElement(null);searchState.removeQueryParameters()},getQueryStringParams:()=>{const params={};window.location.search.substring(1).split("&").map(s=>{const pair=s.split("=").map(x=>x.replace(/\+/g," "));params[decodeURIComponent(pair[0])]=typeof pair[1]==="undefined"?null:decodeURIComponent(pair[1])});return params},setup:()=>{const search_input=searchState.input;if(!searchState.input){return}let searchLoaded=false;function sendSearchForm(){document.getElementsByClassName("search-form")[0].submit()}function loadSearch(){if(!searchLoaded){searchLoaded=true;loadScript(getVar("static-root-path")+getVar("search-js"),sendSearchForm);loadScript(resourcePath("search-index",".js"),sendSearchForm)}}search_input.addEventListener("focus",()=>{search_input.origPlaceholder=search_input.placeholder;search_input.placeholder="Type your search here.";loadSearch()});if(search_input.value!==""){loadSearch()}const params=searchState.getQueryStringParams();if(params.search!==undefined){searchState.setLoadingSearch();loadSearch()}},setLoadingSearch:()=>{const search=searchState.outputElement();search.innerHTML="

"+searchState.loadingText+"

";searchState.showResults(search)},descShards:new Map(),loadDesc:async function({descShard,descIndex}){if(descShard.promise===null){descShard.promise=new Promise((resolve,reject)=>{descShard.resolve=resolve;const ds=descShard;const fname=`${ds.crate}-desc-${ds.shard}-`;const url=resourcePath(`search.desc/${descShard.crate}/${fname}`,".js",);loadScript(url,reject)})}const list=await descShard.promise;return list[descIndex]},loadedDescShard:function(crate,shard,data){this.descShards.get(crate)[shard].resolve(data.split("\n"))},};const toggleAllDocsId="toggle-all-docs";let savedHash="";function handleHashes(ev){if(ev!==null&&searchState.isDisplayed()&&ev.newURL){switchDisplayedElement(null);const hash=ev.newURL.slice(ev.newURL.indexOf("#")+1);if(browserSupportsHistoryApi()){history.replaceState(null,"",getNakedUrl()+window.location.search+"#"+hash)}const elem=document.getElementById(hash);if(elem){elem.scrollIntoView()}}const pageId=window.location.hash.replace(/^#/,"");if(savedHash!==pageId){savedHash=pageId;if(pageId!==""){expandSection(pageId)}}if(savedHash.startsWith("impl-")){const splitAt=savedHash.indexOf("/");if(splitAt!==-1){const implId=savedHash.slice(0,splitAt);const assocId=savedHash.slice(splitAt+1);const implElem=document.getElementById(implId);if(implElem&&implElem.parentElement.tagName==="SUMMARY"&&implElem.parentElement.parentElement.tagName==="DETAILS"){onEachLazy(implElem.parentElement.parentElement.querySelectorAll(`[id^="${assocId}"]`),item=>{const numbered=/([^-]+)-([0-9]+)/.exec(item.id);if(item.id===assocId||(numbered&&numbered[1]===assocId)){openParentDetails(item);item.scrollIntoView();setTimeout(()=>{window.location.replace("#"+item.id)},0)}},)}}}}function onHashChange(ev){hideSidebar();handleHashes(ev)}function openParentDetails(elem){while(elem){if(elem.tagName==="DETAILS"){elem.open=true}elem=elem.parentNode}}function expandSection(id){openParentDetails(document.getElementById(id))}function handleEscape(ev){searchState.clearInputTimeout();searchState.hideResults();ev.preventDefault();searchState.defocus();window.hideAllModals(true)}function handleShortcut(ev){const disableShortcuts=getSettingValue("disable-shortcuts")==="true";if(ev.ctrlKey||ev.altKey||ev.metaKey||disableShortcuts){return}if(document.activeElement.tagName==="INPUT"&&document.activeElement.type!=="checkbox"&&document.activeElement.type!=="radio"){switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break}}else{switch(getVirtualKey(ev)){case"Escape":handleEscape(ev);break;case"s":case"S":case"/":ev.preventDefault();searchState.focus();break;case"+":ev.preventDefault();expandAllDocs();break;case"-":ev.preventDefault();collapseAllDocs();break;case"?":showHelp();break;default:break}}}document.addEventListener("keypress",handleShortcut);document.addEventListener("keydown",handleShortcut);function addSidebarItems(){if(!window.SIDEBAR_ITEMS){return}const sidebar=document.getElementsByClassName("sidebar-elems")[0];function block(shortty,id,longty){const filtered=window.SIDEBAR_ITEMS[shortty];if(!filtered){return}const modpath=hasClass(document.querySelector(".rustdoc"),"mod")?"../":"";const h3=document.createElement("h3");h3.innerHTML=`${longty}`;const ul=document.createElement("ul");ul.className="block "+shortty;for(const name of filtered){let path;if(shortty==="mod"){path=`${modpath}${name}/index.html`}else{path=`${modpath}${shortty}.${name}.html`}let current_page=document.location.href.toString();if(current_page.endsWith("/")){current_page+="index.html"}const link=document.createElement("a");link.href=path;if(path===current_page){link.className="current"}link.textContent=name;const li=document.createElement("li");li.appendChild(link);ul.appendChild(li)}sidebar.appendChild(h3);sidebar.appendChild(ul)}if(sidebar){block("primitive","primitives","Primitive Types");block("mod","modules","Modules");block("macro","macros","Macros");block("struct","structs","Structs");block("enum","enums","Enums");block("constant","constants","Constants");block("static","static","Statics");block("trait","traits","Traits");block("fn","functions","Functions");block("type","types","Type Aliases");block("union","unions","Unions");block("foreigntype","foreign-types","Foreign Types");block("keyword","keywords","Keywords");block("opaque","opaque-types","Opaque Types");block("attr","attributes","Attribute Macros");block("derive","derives","Derive Macros");block("traitalias","trait-aliases","Trait Aliases")}}window.register_implementors=imp=>{const implementors=document.getElementById("implementors-list");const synthetic_implementors=document.getElementById("synthetic-implementors-list");const inlined_types=new Set();const TEXT_IDX=0;const SYNTHETIC_IDX=1;const TYPES_IDX=2;if(synthetic_implementors){onEachLazy(synthetic_implementors.getElementsByClassName("impl"),el=>{const aliases=el.getAttribute("data-aliases");if(!aliases){return}aliases.split(",").forEach(alias=>{inlined_types.add(alias)})})}let currentNbImpls=implementors.getElementsByClassName("impl").length;const traitName=document.querySelector(".main-heading h1 > .trait").textContent;const baseIdName="impl-"+traitName+"-";const libs=Object.getOwnPropertyNames(imp);const script=document.querySelector("script[data-ignore-extern-crates]");const ignoreExternCrates=new Set((script?script.getAttribute("data-ignore-extern-crates"):"").split(","),);for(const lib of libs){if(lib===window.currentCrate||ignoreExternCrates.has(lib)){continue}const structs=imp[lib];struct_loop:for(const struct of structs){const list=struct[SYNTHETIC_IDX]?synthetic_implementors:implementors;if(struct[SYNTHETIC_IDX]){for(const struct_type of struct[TYPES_IDX]){if(inlined_types.has(struct_type)){continue struct_loop}inlined_types.add(struct_type)}}const code=document.createElement("h3");code.innerHTML=struct[TEXT_IDX];addClass(code,"code-header");onEachLazy(code.getElementsByTagName("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});const currentId=baseIdName+currentNbImpls;const anchor=document.createElement("a");anchor.href="#"+currentId;addClass(anchor,"anchor");const display=document.createElement("div");display.id=currentId;addClass(display,"impl");display.appendChild(anchor);display.appendChild(code);list.appendChild(display);currentNbImpls+=1}}};if(window.pending_implementors){window.register_implementors(window.pending_implementors)}window.register_type_impls=imp=>{if(!imp||!imp[window.currentCrate]){return}window.pending_type_impls=null;const idMap=new Map();let implementations=document.getElementById("implementations-list");let trait_implementations=document.getElementById("trait-implementations-list");let trait_implementations_header=document.getElementById("trait-implementations");const script=document.querySelector("script[data-self-path]");const selfPath=script?script.getAttribute("data-self-path"):null;const mainContent=document.querySelector("#main-content");const sidebarSection=document.querySelector(".sidebar section");let methods=document.querySelector(".sidebar .block.method");let associatedTypes=document.querySelector(".sidebar .block.associatedtype");let associatedConstants=document.querySelector(".sidebar .block.associatedconstant");let sidebarTraitList=document.querySelector(".sidebar .block.trait-implementation");for(const impList of imp[window.currentCrate]){const types=impList.slice(2);const text=impList[0];const isTrait=impList[1]!==0;const traitName=impList[1];if(types.indexOf(selfPath)===-1){continue}let outputList=isTrait?trait_implementations:implementations;if(outputList===null){const outputListName=isTrait?"Trait Implementations":"Implementations";const outputListId=isTrait?"trait-implementations-list":"implementations-list";const outputListHeaderId=isTrait?"trait-implementations":"implementations";const outputListHeader=document.createElement("h2");outputListHeader.id=outputListHeaderId;outputListHeader.innerText=outputListName;outputList=document.createElement("div");outputList.id=outputListId;if(isTrait){const link=document.createElement("a");link.href=`#${outputListHeaderId}`;link.innerText="Trait Implementations";const h=document.createElement("h3");h.appendChild(link);trait_implementations=outputList;trait_implementations_header=outputListHeader;sidebarSection.appendChild(h);sidebarTraitList=document.createElement("ul");sidebarTraitList.className="block trait-implementation";sidebarSection.appendChild(sidebarTraitList);mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}else{implementations=outputList;if(trait_implementations){mainContent.insertBefore(outputListHeader,trait_implementations_header);mainContent.insertBefore(outputList,trait_implementations_header)}else{const mainContent=document.querySelector("#main-content");mainContent.appendChild(outputListHeader);mainContent.appendChild(outputList)}}}const template=document.createElement("template");template.innerHTML=text;onEachLazy(template.content.querySelectorAll("a"),elem=>{const href=elem.getAttribute("href");if(href&&!href.startsWith("#")&&!/^(?:[a-z+]+:)?\/\//.test(href)){elem.setAttribute("href",window.rootPath+href)}});onEachLazy(template.content.querySelectorAll("[id]"),el=>{let i=0;if(idMap.has(el.id)){i=idMap.get(el.id)}else if(document.getElementById(el.id)){i=1;while(document.getElementById(`${el.id}-${2 * i}`)){i=2*i}while(document.getElementById(`${el.id}-${i}`)){i+=1}}if(i!==0){const oldHref=`#${el.id}`;const newHref=`#${el.id}-${i}`;el.id=`${el.id}-${i}`;onEachLazy(template.content.querySelectorAll("a[href]"),link=>{if(link.getAttribute("href")===oldHref){link.href=newHref}})}idMap.set(el.id,i+1)});const templateAssocItems=template.content.querySelectorAll("section.tymethod, "+"section.method, section.associatedtype, section.associatedconstant");if(isTrait){const li=document.createElement("li");const a=document.createElement("a");a.href=`#${template.content.querySelector(".impl").id}`;a.textContent=traitName;li.appendChild(a);sidebarTraitList.append(li)}else{onEachLazy(templateAssocItems,item=>{let block=hasClass(item,"associatedtype")?associatedTypes:(hasClass(item,"associatedconstant")?associatedConstants:(methods));if(!block){const blockTitle=hasClass(item,"associatedtype")?"Associated Types":(hasClass(item,"associatedconstant")?"Associated Constants":("Methods"));const blockClass=hasClass(item,"associatedtype")?"associatedtype":(hasClass(item,"associatedconstant")?"associatedconstant":("method"));const blockHeader=document.createElement("h3");const blockLink=document.createElement("a");blockLink.href="#implementations";blockLink.innerText=blockTitle;blockHeader.appendChild(blockLink);block=document.createElement("ul");block.className=`block ${blockClass}`;const insertionReference=methods||sidebarTraitList;if(insertionReference){const insertionReferenceH=insertionReference.previousElementSibling;sidebarSection.insertBefore(blockHeader,insertionReferenceH);sidebarSection.insertBefore(block,insertionReferenceH)}else{sidebarSection.appendChild(blockHeader);sidebarSection.appendChild(block)}if(hasClass(item,"associatedtype")){associatedTypes=block}else if(hasClass(item,"associatedconstant")){associatedConstants=block}else{methods=block}}const li=document.createElement("li");const a=document.createElement("a");a.innerText=item.id.split("-")[0].split(".")[1];a.href=`#${item.id}`;li.appendChild(a);block.appendChild(li)})}outputList.appendChild(template.content)}for(const list of[methods,associatedTypes,associatedConstants,sidebarTraitList]){if(!list){continue}const newChildren=Array.prototype.slice.call(list.children);newChildren.sort((a,b)=>{const aI=a.innerText;const bI=b.innerText;return aIbI?1:0});list.replaceChildren(...newChildren)}};if(window.pending_type_impls){window.register_type_impls(window.pending_type_impls)}function addSidebarCrates(){if(!window.ALL_CRATES){return}const sidebarElems=document.getElementsByClassName("sidebar-elems")[0];if(!sidebarElems){return}const h3=document.createElement("h3");h3.innerHTML="Crates";const ul=document.createElement("ul");ul.className="block crate";for(const crate of window.ALL_CRATES){const link=document.createElement("a");link.href=window.rootPath+crate+"/index.html";link.textContent=crate;const li=document.createElement("li");if(window.rootPath!=="./"&&crate===window.currentCrate){li.className="current"}li.appendChild(link);ul.appendChild(li)}sidebarElems.appendChild(h3);sidebarElems.appendChild(ul)}function expandAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);removeClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hasClass(e,"type-contents-toggle")&&!hasClass(e,"more-examples-toggle")){e.open=true}});innerToggle.title="collapse all docs";innerToggle.children[0].innerText="\u2212"}function collapseAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);addClass(innerToggle,"will-expand");onEachLazy(document.getElementsByClassName("toggle"),e=>{if(e.parentNode.id!=="implementations-list"||(!hasClass(e,"implementors-toggle")&&!hasClass(e,"type-contents-toggle"))){e.open=false}});innerToggle.title="expand all docs";innerToggle.children[0].innerText="+"}function toggleAllDocs(){const innerToggle=document.getElementById(toggleAllDocsId);if(!innerToggle){return}if(hasClass(innerToggle,"will-expand")){expandAllDocs()}else{collapseAllDocs()}}(function(){const toggles=document.getElementById(toggleAllDocsId);if(toggles){toggles.onclick=toggleAllDocs}const hideMethodDocs=getSettingValue("auto-hide-method-docs")==="true";const hideImplementations=getSettingValue("auto-hide-trait-implementations")==="true";const hideLargeItemContents=getSettingValue("auto-hide-large-items")!=="false";function setImplementorsTogglesOpen(id,open){const list=document.getElementById(id);if(list!==null){onEachLazy(list.getElementsByClassName("implementors-toggle"),e=>{e.open=open})}}if(hideImplementations){setImplementorsTogglesOpen("trait-implementations-list",false);setImplementorsTogglesOpen("blanket-implementations-list",false)}onEachLazy(document.getElementsByClassName("toggle"),e=>{if(!hideLargeItemContents&&hasClass(e,"type-contents-toggle")){e.open=true}if(hideMethodDocs&&hasClass(e,"method-toggle")){e.open=false}})}());window.rustdoc_add_line_numbers_to_examples=()=>{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");if(line_numbers.length>0){return}const count=x.textContent.split("\n").length;const elems=[];for(let i=0;i{onEachLazy(document.getElementsByClassName("rust-example-rendered"),x=>{const parent=x.parentNode;const line_numbers=parent.querySelectorAll(".example-line-numbers");for(const node of line_numbers){parent.removeChild(node)}})};if(getSettingValue("line-numbers")==="true"){window.rustdoc_add_line_numbers_to_examples()}function showSidebar(){window.hideAllModals(false);const sidebar=document.getElementsByClassName("sidebar")[0];addClass(sidebar,"shown")}function hideSidebar(){const sidebar=document.getElementsByClassName("sidebar")[0];removeClass(sidebar,"shown")}window.addEventListener("resize",()=>{if(window.CURRENT_TOOLTIP_ELEMENT){const base=window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE;const force_visible=base.TOOLTIP_FORCE_VISIBLE;hideTooltip(false);if(force_visible){showTooltip(base);base.TOOLTIP_FORCE_VISIBLE=true}}});const mainElem=document.getElementById(MAIN_ID);if(mainElem){mainElem.addEventListener("click",hideSidebar)}onEachLazy(document.querySelectorAll("a[href^='#']"),el=>{el.addEventListener("click",()=>{expandSection(el.hash.slice(1));hideSidebar()})});onEachLazy(document.querySelectorAll(".toggle > summary:not(.hideme)"),el=>{el.addEventListener("click",e=>{if(e.target.tagName!=="SUMMARY"&&e.target.tagName!=="A"){e.preventDefault()}})});function showTooltip(e){const notable_ty=e.getAttribute("data-notable-ty");if(!window.NOTABLE_TRAITS&¬able_ty){const data=document.getElementById("notable-traits-data");if(data){window.NOTABLE_TRAITS=JSON.parse(data.innerText)}else{throw new Error("showTooltip() called with notable without any notable traits!")}}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE===e){clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);return}window.hideAllModals(false);const wrapper=document.createElement("div");if(notable_ty){wrapper.innerHTML="
"+window.NOTABLE_TRAITS[notable_ty]+"
"}else{if(e.getAttribute("title")!==null){e.setAttribute("data-title",e.getAttribute("title"));e.removeAttribute("title")}if(e.getAttribute("data-title")!==null){const titleContent=document.createElement("div");titleContent.className="content";titleContent.appendChild(document.createTextNode(e.getAttribute("data-title")));wrapper.appendChild(titleContent)}}wrapper.className="tooltip popover";const focusCatcher=document.createElement("div");focusCatcher.setAttribute("tabindex","0");focusCatcher.onfocus=hideTooltip;wrapper.appendChild(focusCatcher);const pos=e.getBoundingClientRect();wrapper.style.top=(pos.top+window.scrollY+pos.height)+"px";wrapper.style.left=0;wrapper.style.right="auto";wrapper.style.visibility="hidden";const body=document.getElementsByTagName("body")[0];body.appendChild(wrapper);const wrapperPos=wrapper.getBoundingClientRect();const finalPos=pos.left+window.scrollX-wrapperPos.width+24;if(finalPos>0){wrapper.style.left=finalPos+"px"}else{wrapper.style.setProperty("--popover-arrow-offset",(wrapperPos.right-pos.right+4)+"px",)}wrapper.style.visibility="";window.CURRENT_TOOLTIP_ELEMENT=wrapper;window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE=e;clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);wrapper.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}clearTooltipHoverTimeout(e)};wrapper.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&!e.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(wrapper,"fade-out")}}}function setTooltipHoverTimeout(element,show){clearTooltipHoverTimeout(element);if(!show&&!window.CURRENT_TOOLTIP_ELEMENT){return}if(show&&window.CURRENT_TOOLTIP_ELEMENT){return}if(window.CURRENT_TOOLTIP_ELEMENT&&window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE!==element){return}element.TOOLTIP_HOVER_TIMEOUT=setTimeout(()=>{if(show){showTooltip(element)}else if(!element.TOOLTIP_FORCE_VISIBLE){hideTooltip(false)}},show?window.RUSTDOC_TOOLTIP_HOVER_MS:window.RUSTDOC_TOOLTIP_HOVER_EXIT_MS)}function clearTooltipHoverTimeout(element){if(element.TOOLTIP_HOVER_TIMEOUT!==undefined){removeClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out");clearTimeout(element.TOOLTIP_HOVER_TIMEOUT);delete element.TOOLTIP_HOVER_TIMEOUT}}function tooltipBlurHandler(event){if(window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.contains(event.relatedTarget)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(document.activeElement)&&!window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.contains(event.relatedTarget)){setTimeout(()=>hideTooltip(false),0)}}function hideTooltip(focus){if(window.CURRENT_TOOLTIP_ELEMENT){if(window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE){if(focus){window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.focus()}window.CURRENT_TOOLTIP_ELEMENT.TOOLTIP_BASE.TOOLTIP_FORCE_VISIBLE=false}const body=document.getElementsByTagName("body")[0];body.removeChild(window.CURRENT_TOOLTIP_ELEMENT);clearTooltipHoverTimeout(window.CURRENT_TOOLTIP_ELEMENT);window.CURRENT_TOOLTIP_ELEMENT=null}}onEachLazy(document.getElementsByClassName("tooltip"),e=>{e.onclick=()=>{e.TOOLTIP_FORCE_VISIBLE=e.TOOLTIP_FORCE_VISIBLE?false:true;if(window.CURRENT_TOOLTIP_ELEMENT&&!e.TOOLTIP_FORCE_VISIBLE){hideTooltip(true)}else{showTooltip(e);window.CURRENT_TOOLTIP_ELEMENT.setAttribute("tabindex","0");window.CURRENT_TOOLTIP_ELEMENT.focus();window.CURRENT_TOOLTIP_ELEMENT.onblur=tooltipBlurHandler}return false};e.onpointerenter=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointermove=ev=>{if(ev.pointerType!=="mouse"){return}setTooltipHoverTimeout(e,true)};e.onpointerleave=ev=>{if(ev.pointerType!=="mouse"){return}if(!e.TOOLTIP_FORCE_VISIBLE&&window.CURRENT_TOOLTIP_ELEMENT&&!window.CURRENT_TOOLTIP_ELEMENT.contains(ev.relatedTarget)){setTooltipHoverTimeout(e,false);addClass(window.CURRENT_TOOLTIP_ELEMENT,"fade-out")}}});const sidebar_menu_toggle=document.getElementsByClassName("sidebar-menu-toggle")[0];if(sidebar_menu_toggle){sidebar_menu_toggle.addEventListener("click",()=>{const sidebar=document.getElementsByClassName("sidebar")[0];if(!hasClass(sidebar,"shown")){showSidebar()}else{hideSidebar()}})}function helpBlurHandler(event){blurHandler(event,getHelpButton(),window.hidePopoverMenus)}function buildHelpMenu(){const book_info=document.createElement("span");const channel=getVar("channel");book_info.className="top";book_info.innerHTML=`You can find more information in \ +the rustdoc book.`;const shortcuts=[["?","Show this help dialog"],["S / /","Focus the search field"],["↑","Move up in search results"],["↓","Move down in search results"],["← / →","Switch result tab (when results focused)"],["⏎","Go to active search result"],["+","Expand all sections"],["-","Collapse all sections"],].map(x=>"
"+x[0].split(" ").map((y,index)=>((index&1)===0?""+y+"":" "+y+" ")).join("")+"
"+x[1]+"
").join("");const div_shortcuts=document.createElement("div");addClass(div_shortcuts,"shortcuts");div_shortcuts.innerHTML="

Keyboard Shortcuts

"+shortcuts+"
";const infos=[`For a full list of all search features, take a look here.`,"Prefix searches with a type followed by a colon (e.g., fn:) to \ + restrict the search to a given item kind.","Accepted kinds are: fn, mod, struct, \ + enum, trait, type, macro, \ + and const.","Search functions by type signature (e.g., vec -> usize or \ + -> vec or String, enum:Cow -> bool)","You can look for items with an exact name by putting double quotes around \ + your request: \"string\"","Look for functions that accept or return \ + slices and \ + arrays by writing \ + square brackets (e.g., -> [u8] or [] -> Option)","Look for items inside another one by searching for a path: vec::Vec",].map(x=>"

"+x+"

").join("");const div_infos=document.createElement("div");addClass(div_infos,"infos");div_infos.innerHTML="

Search Tricks

"+infos;const rustdoc_version=document.createElement("span");rustdoc_version.className="bottom";const rustdoc_version_code=document.createElement("code");rustdoc_version_code.innerText="rustdoc "+getVar("rustdoc-version");rustdoc_version.appendChild(rustdoc_version_code);const container=document.createElement("div");if(!isHelpPage){container.className="popover"}container.id="help";container.style.display="none";const side_by_side=document.createElement("div");side_by_side.className="side-by-side";side_by_side.appendChild(div_shortcuts);side_by_side.appendChild(div_infos);container.appendChild(book_info);container.appendChild(side_by_side);container.appendChild(rustdoc_version);if(isHelpPage){const help_section=document.createElement("section");help_section.appendChild(container);document.getElementById("main-content").appendChild(help_section);container.style.display="block"}else{const help_button=getHelpButton();help_button.appendChild(container);container.onblur=helpBlurHandler;help_button.onblur=helpBlurHandler;help_button.children[0].onblur=helpBlurHandler}return container}window.hideAllModals=switchFocus=>{hideSidebar();window.hidePopoverMenus();hideTooltip(switchFocus)};window.hidePopoverMenus=()=>{onEachLazy(document.querySelectorAll(".search-form .popover"),elem=>{elem.style.display="none"})};function getHelpMenu(buildNeeded){let menu=getHelpButton().querySelector(".popover");if(!menu&&buildNeeded){menu=buildHelpMenu()}return menu}function showHelp(){getHelpButton().querySelector("a").focus();const menu=getHelpMenu(true);if(menu.style.display==="none"){window.hideAllModals();menu.style.display=""}}if(isHelpPage){showHelp();document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault()})}else{document.querySelector(`#${HELP_BUTTON_ID} > a`).addEventListener("click",event=>{const target=event.target;if(target.tagName!=="A"||target.parentElement.id!==HELP_BUTTON_ID||event.ctrlKey||event.altKey||event.metaKey){return}event.preventDefault();const menu=getHelpMenu(true);const shouldShowHelp=menu.style.display==="none";if(shouldShowHelp){showHelp()}else{window.hidePopoverMenus()}})}setMobileTopbar();addSidebarItems();addSidebarCrates();onHashChange(null);window.addEventListener("hashchange",onHashChange);searchState.setup()}());(function(){const SIDEBAR_MIN=100;const SIDEBAR_MAX=500;const RUSTDOC_MOBILE_BREAKPOINT=700;const BODY_MIN=400;const SIDEBAR_VANISH_THRESHOLD=SIDEBAR_MIN/2;const sidebarButton=document.getElementById("sidebar-button");if(sidebarButton){sidebarButton.addEventListener("click",e=>{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false");if(document.querySelector(".rustdoc.src")){window.rustdocToggleSrcSidebar()}e.preventDefault()})}let currentPointerId=null;let desiredSidebarSize=null;let pendingSidebarResizingFrame=false;const resizer=document.querySelector(".sidebar-resizer");const sidebar=document.querySelector(".sidebar");if(!resizer||!sidebar){return}const isSrcPage=hasClass(document.body,"src");function hideSidebar(){if(isSrcPage){window.rustdocCloseSourceSidebar();updateLocalStorage("src-sidebar-width",null);document.documentElement.style.removeProperty("--src-sidebar-width");sidebar.style.removeProperty("--src-sidebar-width");resizer.style.removeProperty("--src-sidebar-width")}else{addClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","true");updateLocalStorage("desktop-sidebar-width",null);document.documentElement.style.removeProperty("--desktop-sidebar-width");sidebar.style.removeProperty("--desktop-sidebar-width");resizer.style.removeProperty("--desktop-sidebar-width")}}function showSidebar(){if(isSrcPage){window.rustdocShowSourceSidebar()}else{removeClass(document.documentElement,"hide-sidebar");updateLocalStorage("hide-sidebar","false")}}function changeSidebarSize(size){if(isSrcPage){updateLocalStorage("src-sidebar-width",size);sidebar.style.setProperty("--src-sidebar-width",size+"px");resizer.style.setProperty("--src-sidebar-width",size+"px")}else{updateLocalStorage("desktop-sidebar-width",size);sidebar.style.setProperty("--desktop-sidebar-width",size+"px");resizer.style.setProperty("--desktop-sidebar-width",size+"px")}}function isSidebarHidden(){return isSrcPage?!hasClass(document.documentElement,"src-sidebar-expanded"):hasClass(document.documentElement,"hide-sidebar")}function resize(e){if(currentPointerId===null||currentPointerId!==e.pointerId){return}e.preventDefault();const pos=e.clientX-3;if(pos=SIDEBAR_MIN){if(isSidebarHidden()){showSidebar()}const constrainedPos=Math.min(pos,window.innerWidth-BODY_MIN,SIDEBAR_MAX);changeSidebarSize(constrainedPos);desiredSidebarSize=constrainedPos;if(pendingSidebarResizingFrame!==false){clearTimeout(pendingSidebarResizingFrame)}pendingSidebarResizingFrame=setTimeout(()=>{if(currentPointerId===null||pendingSidebarResizingFrame===false){return}pendingSidebarResizingFrame=false;document.documentElement.style.setProperty("--resizing-sidebar-width",desiredSidebarSize+"px",)},100)}}window.addEventListener("resize",()=>{if(window.innerWidth=(window.innerWidth-BODY_MIN)){changeSidebarSize(window.innerWidth-BODY_MIN)}else if(desiredSidebarSize!==null&&desiredSidebarSize>SIDEBAR_MIN){changeSidebarSize(desiredSidebarSize)}});function stopResize(e){if(currentPointerId===null){return}if(e){e.preventDefault()}desiredSidebarSize=sidebar.getBoundingClientRect().width;removeClass(resizer,"active");window.removeEventListener("pointermove",resize,false);window.removeEventListener("pointerup",stopResize,false);removeClass(document.documentElement,"sidebar-resizing");document.documentElement.style.removeProperty("--resizing-sidebar-width");if(resizer.releasePointerCapture){resizer.releasePointerCapture(currentPointerId);currentPointerId=null}}function initResize(e){if(currentPointerId!==null||e.altKey||e.ctrlKey||e.metaKey||e.button!==0){return}if(resizer.setPointerCapture){resizer.setPointerCapture(e.pointerId);if(!resizer.hasPointerCapture(e.pointerId)){resizer.releasePointerCapture(e.pointerId);return}currentPointerId=e.pointerId}window.hideAllModals(false);e.preventDefault();window.addEventListener("pointermove",resize,false);window.addEventListener("pointercancel",stopResize,false);window.addEventListener("pointerup",stopResize,false);addClass(resizer,"active");addClass(document.documentElement,"sidebar-resizing");const pos=e.clientX-sidebar.offsetLeft-3;document.documentElement.style.setProperty("--resizing-sidebar-width",pos+"px");desiredSidebarSize=null}resizer.addEventListener("pointerdown",initResize,false)}());(function(){let reset_button_timeout=null;const but=document.getElementById("copy-path");if(!but){return}but.onclick=()=>{const parent=but.parentElement;const path=[];onEach(parent.childNodes,child=>{if(child.tagName==="A"){path.push(child.textContent)}});const el=document.createElement("textarea");el.value=path.join("::");el.setAttribute("readonly","");el.style.position="absolute";el.style.left="-9999px";document.body.appendChild(el);el.select();document.execCommand("copy");document.body.removeChild(el);but.classList.add("clicked");if(reset_button_timeout!==null){window.clearTimeout(reset_button_timeout)}function reset_button(){reset_button_timeout=null;but.classList.remove("clicked")}reset_button_timeout=window.setTimeout(reset_button,1000)}}()) \ No newline at end of file diff --git a/ch5/static.files/noscript-04d5337699b92874.css b/ch5/static.files/noscript-04d5337699b92874.css deleted file mode 100644 index fbd55f57..00000000 --- a/ch5/static.files/noscript-04d5337699b92874.css +++ /dev/null @@ -1 +0,0 @@ - #main-content .attributes{margin-left:0 !important;}#copy-path,#sidebar-button,.sidebar-resizer{display:none !important;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}@media (prefers-color-scheme:dark){:root{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}} \ No newline at end of file diff --git a/ch5/static.files/noscript-09095024cf37855e.css b/ch5/static.files/noscript-09095024cf37855e.css new file mode 100644 index 00000000..59786941 --- /dev/null +++ b/ch5/static.files/noscript-09095024cf37855e.css @@ -0,0 +1 @@ + #main-content .attributes{margin-left:0 !important;}#copy-path,#sidebar-button,.sidebar-resizer{display:none !important;}nav.sub{display:none;}.src .sidebar{display:none;}.notable-traits{display:none;}:root,:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}@media (prefers-color-scheme:dark){:root,:root:not([data-theme]){--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}} \ No newline at end of file diff --git a/ch5/static.files/rustdoc-4e54bb2b497cc83f.css b/ch5/static.files/rustdoc-b21aa549bf6d91ff.css similarity index 56% rename from ch5/static.files/rustdoc-4e54bb2b497cc83f.css rename to ch5/static.files/rustdoc-b21aa549bf6d91ff.css index ce5efae4..b0c4e1b6 100644 --- a/ch5/static.files/rustdoc-4e54bb2b497cc83f.css +++ b/ch5/static.files/rustdoc-b21aa549bf6d91ff.css @@ -1,13 +1,35 @@ - :root{--nav-sub-mobile-padding:8px;--search-typename-width:6.75rem;--desktop-sidebar-width:200px;--src-sidebar-width:300px;--desktop-sidebar-z-index:100;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:400;src:local('Fira Sans'),url("FiraSans-Regular-018c141bf0843ffd.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Fira Sans';font-style:normal;font-weight:500;src:local('Fira Sans Medium'),url("FiraSans-Medium-8f9a781e4970d388.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:400;src:local('Source Serif 4'),url("SourceSerif4-Regular-46f98efaafac5295.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:italic;font-weight:400;src:local('Source Serif 4 Italic'),url("SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Serif 4';font-style:normal;font-weight:700;src:local('Source Serif 4 Bold'),url("SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:400;src:url("SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:italic;font-weight:400;src:url("SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'Source Code Pro';font-style:normal;font-weight:600;src:url("SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2") format("woff2");font-display:swap;}@font-face {font-family:'NanumBarunGothic';src:url("NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2") format("woff2");font-display:swap;unicode-range:U+AC00-D7AF,U+1100-11FF,U+3130-318F,U+A960-A97F,U+D7B0-D7FF;}*{box-sizing:border-box;}body{font:1rem/1.5 "Source Serif 4",NanumBarunGothic,serif;margin:0;position:relative;overflow-wrap:break-word;overflow-wrap:anywhere;font-feature-settings:"kern","liga";background-color:var(--main-background-color);color:var(--main-color);}h1{font-size:1.5rem;}h2{font-size:1.375rem;}h3{font-size:1.25rem;}h1,h2,h3,h4,h5,h6{font-weight:500;}h1,h2,h3,h4{margin:25px 0 15px 0;padding-bottom:6px;}.docblock h3,.docblock h4,h5,h6{margin:15px 0 5px 0;}.docblock>h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.logo-container{line-height:0;display:block;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 var(--desktop-sidebar-width);width:var(--desktop-sidebar-width);overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;z-index:var(--desktop-sidebar-z-index);}.rustdoc.src .sidebar{flex-basis:50px;width:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.hide-sidebar .sidebar,.hide-sidebar .sidebar-resizer{display:none;}.sidebar-resizer{touch-action:none;width:9px;cursor:col-resize;z-index:calc(var(--desktop-sidebar-z-index) + 1);position:fixed;height:100%;left:calc(var(--desktop-sidebar-width) + 1px);}.rustdoc.src .sidebar-resizer{left:49px;}.src-sidebar-expanded .src .sidebar-resizer{left:var(--src-sidebar-width);}.sidebar-resizing{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.sidebar-resizing*{cursor:col-resize !important;}.sidebar-resizing .sidebar{position:fixed;}.sidebar-resizing>body{padding-left:var(--resizing-sidebar-width);}.sidebar-resizer:hover,.sidebar-resizer:active,.sidebar-resizer:focus,.sidebar-resizer.active{width:10px;margin:0;left:var(--desktop-sidebar-width);border-left:solid 1px var(--sidebar-resizer-hover);}.src-sidebar-expanded .rustdoc.src .sidebar-resizer:hover,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:active,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:focus,.src-sidebar-expanded .rustdoc.src .sidebar-resizer.active{left:calc(var(--src-sidebar-width) - 1px);}@media (pointer:coarse){.sidebar-resizer{display:none !important;}}.sidebar-resizer.active{padding:0 140px;width:2px;margin-left:-140px;border-left:none;}.sidebar-resizer.active:before{border-left:solid 2px var(--sidebar-resizer-active);display:block;height:100%;content:"";}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}.src .sidebar>*{visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:var(--src-sidebar-width);width:var(--src-sidebar-width);}.src-sidebar-expanded .src .sidebar>*{visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;margin-right:0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.5rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.5rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;margin-top:calc((-16px + 0.57rem ) / 2 );}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}div.where{white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block li.current a{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml,h2:first-child,.docblock>h3:first-child,.docblock>h4:first-child,.docblock>h5:first-child,.docblock>h6:first-child{margin-top:0;}.main-heading h1{margin:0;padding:0;flex-grow:1;overflow-wrap:break-word;overflow-wrap:anywhere;}.main-heading{display:flex;flex-wrap:wrap;padding-bottom:6px;margin-bottom:15px;}.content h2,.top-doc .docblock>h3,.top-doc .docblock>h4{border-bottom:1px solid var(--headings-border-bottom-color);}h1,h2{line-height:1.25;padding-top:3px;padding-bottom:9px;}h3.code-header{font-size:1.125rem;}h4.code-header{font-size:1rem;}.code-header{font-weight:600;margin:0;padding:0;white-space:pre-wrap;}#crate-search,h1,h2,h3,h4,h5,h6,.sidebar,.mobile-topbar,.search-input,.search-results .result-name,.item-name>a,.out-of-band,span.since,a.src,#help-button>a,summary.hideme,.scraped-example-list,ul.all-items{font-family:"Fira Sans",Arial,NanumBarunGothic,sans-serif;}#toggle-all-docs,a.anchor,.section-header a,#src-sidebar a,.rust a,.sidebar h2 a,.sidebar h3 a,.mobile-topbar h2 a,h1 a,.search-results a,.stab,.result-name i{color:var(--main-color);}span.enum,a.enum,span.struct,a.struct,span.union,a.union,span.primitive,a.primitive,span.type,a.type,span.foreigntype,a.foreigntype{color:var(--type-link-color);}span.trait,a.trait,span.traitalias,a.traitalias{color:var(--trait-link-color);}span.associatedtype,a.associatedtype,span.constant,a.constant,span.static,a.static{color:var(--assoc-item-link-color);}span.fn,a.fn,span.method,a.method,span.tymethod,a.tymethod{color:var(--function-link-color);}span.attr,a.attr,span.derive,a.derive,span.macro,a.macro{color:var(--macro-link-color);}span.mod,a.mod{color:var(--mod-link-color);}span.keyword,a.keyword{color:var(--keyword-link-color);}a{color:var(--link-color);text-decoration:none;}ol,ul{padding-left:24px;}ul ul,ol ul,ul ol,ol ol{margin-bottom:.625em;}p,.docblock>.warning{margin:0 0 .75em 0;}p:last-child,.docblock>.warning:last-child{margin:0;}button{padding:1px 6px;cursor:pointer;}button#toggle-all-docs{padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.rustdoc{display:flex;flex-direction:row;flex-wrap:nowrap;}main{position:relative;flex-grow:1;padding:10px 15px 40px 45px;min-width:0;}.src main{padding:15px;}.width-limiter{max-width:960px;margin-right:auto;}details:not(.toggle) summary{margin-bottom:.6em;}code,pre,a.test-arrow,.code-header{font-family:"Source Code Pro",monospace;}.docblock code,.docblock-short code{border-radius:3px;padding:0 0.125em;}.docblock pre code,.docblock-short pre code{padding:0;}pre{padding:14px;line-height:1.5;}pre.item-decl{overflow-x:auto;}.item-decl .type-contents-toggle{contain:initial;}.src .content pre{padding:20px;}.rustdoc.src .example-wrap pre.src-line-numbers{padding:20px 0 20px 4px;}img{max-width:100%;}.logo-container{line-height:0;display:block;}.rust-logo{filter:var(--rust-logo-filter);}.sidebar{font-size:0.875rem;flex:0 0 var(--desktop-sidebar-width);width:var(--desktop-sidebar-width);overflow-y:scroll;overscroll-behavior:contain;position:sticky;height:100vh;top:0;left:0;z-index:var(--desktop-sidebar-z-index);}.rustdoc.src .sidebar{flex-basis:50px;width:50px;border-right:1px solid;overflow-x:hidden;overflow-y:hidden;}.hide-sidebar .sidebar,.hide-sidebar .sidebar-resizer{display:none;}.sidebar-resizer{touch-action:none;width:9px;cursor:col-resize;z-index:calc(var(--desktop-sidebar-z-index) + 1);position:fixed;height:100%;left:calc(var(--desktop-sidebar-width) + 1px);}.rustdoc.src .sidebar-resizer{left:49px;}.src-sidebar-expanded .src .sidebar-resizer{left:var(--src-sidebar-width);}.sidebar-resizing{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none;}.sidebar-resizing*{cursor:col-resize !important;}.sidebar-resizing .sidebar{position:fixed;}.sidebar-resizing>body{padding-left:var(--resizing-sidebar-width);}.sidebar-resizer:hover,.sidebar-resizer:active,.sidebar-resizer:focus,.sidebar-resizer.active{width:10px;margin:0;left:var(--desktop-sidebar-width);border-left:solid 1px var(--sidebar-resizer-hover);}.src-sidebar-expanded .rustdoc.src .sidebar-resizer:hover,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:active,.src-sidebar-expanded .rustdoc.src .sidebar-resizer:focus,.src-sidebar-expanded .rustdoc.src .sidebar-resizer.active{left:calc(var(--src-sidebar-width) - 1px);}@media (pointer:coarse){.sidebar-resizer{display:none !important;}}.sidebar-resizer.active{padding:0 140px;width:2px;margin-left:-140px;border-left:none;}.sidebar-resizer.active:before{border-left:solid 2px var(--sidebar-resizer-active);display:block;height:100%;content:"";}.sidebar,.mobile-topbar,.sidebar-menu-toggle,#src-sidebar{background-color:var(--sidebar-background-color);}.src .sidebar>*{visibility:hidden;}.src-sidebar-expanded .src .sidebar{overflow-y:auto;flex-basis:var(--src-sidebar-width);width:var(--src-sidebar-width);}.src-sidebar-expanded .src .sidebar>*{visibility:visible;}#all-types{margin-top:1em;}*{scrollbar-width:initial;scrollbar-color:var(--scrollbar-color);}.sidebar{scrollbar-width:thin;scrollbar-color:var(--scrollbar-color);}::-webkit-scrollbar{width:12px;}.sidebar::-webkit-scrollbar{width:8px;}::-webkit-scrollbar-track{-webkit-box-shadow:inset 0;background-color:var(--scrollbar-track-background-color);}.sidebar::-webkit-scrollbar-track{background-color:var(--scrollbar-track-background-color);}::-webkit-scrollbar-thumb,.sidebar::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb-background-color);}.hidden{display:none !important;}.logo-container>img{height:48px;width:48px;}ul.block,.block li{padding:0;margin:0;list-style:none;}.sidebar-elems a,.sidebar>h2 a{display:block;padding:0.25rem;margin-left:-0.25rem;margin-right:0.25rem;}.sidebar h2{overflow-wrap:anywhere;padding:0;margin:0.7rem 0;}.sidebar h3{font-size:1.125rem;padding:0;margin:0;}.sidebar-elems,.sidebar>.version,.sidebar>h2{padding-left:24px;}.sidebar a{color:var(--sidebar-link-color);}.sidebar .current,.sidebar .current a,.sidebar-crate a.logo-container:hover+h2 a,.sidebar a:hover:not(.logo-container){background-color:var(--sidebar-current-link-background-color);}.sidebar-elems .block{margin-bottom:2em;}.sidebar-elems .block li a{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;}.sidebar-crate{display:flex;align-items:center;justify-content:center;margin:14px 32px 1rem;row-gap:10px;column-gap:32px;flex-wrap:wrap;}.sidebar-crate h2{flex-grow:1;margin:0 -8px;align-self:start;}.sidebar-crate .logo-container{margin:0 -16px 0 -16px;text-align:center;}.sidebar-crate h2 a{display:block;margin:0 calc(-24px + 0.25rem) 0 -0.2rem;padding:calc((16px - 0.57rem ) / 2 ) 0.25rem;padding-left:0.2rem;}.sidebar-crate h2 .version{display:block;font-weight:normal;font-size:1rem;overflow-wrap:break-word;}.sidebar-crate+.version{margin-top:-1rem;margin-bottom:1rem;}.mobile-topbar{display:none;}.rustdoc .example-wrap{display:flex;position:relative;margin-bottom:10px;}.rustdoc .example-wrap:last-child{margin-bottom:0px;}.rustdoc .example-wrap pre{margin:0;flex-grow:1;}.rustdoc:not(.src) .example-wrap pre{overflow:auto hidden;}.rustdoc .example-wrap pre.example-line-numbers,.rustdoc .example-wrap pre.src-line-numbers{flex-grow:0;min-width:fit-content;overflow:initial;text-align:right;-webkit-user-select:none;user-select:none;padding:14px 8px;color:var(--src-line-numbers-span-color);}.rustdoc .example-wrap pre.src-line-numbers{padding:14px 0;}.src-line-numbers a,.src-line-numbers span{color:var(--src-line-numbers-span-color);padding:0 8px;}.src-line-numbers :target{background-color:transparent;border-right:none;padding:0 8px;}.src-line-numbers .line-highlighted{background-color:var(--src-line-number-highlighted-background-color);}.search-loading{text-align:center;}.docblock-short{overflow-wrap:break-word;overflow-wrap:anywhere;}.docblock :not(pre)>code,.docblock-short code{white-space:pre-wrap;}.top-doc .docblock h2{font-size:1.375rem;}.top-doc .docblock h3{font-size:1.25rem;}.top-doc .docblock h4,.top-doc .docblock h5{font-size:1.125rem;}.top-doc .docblock h6{font-size:1rem;}.docblock h5{font-size:1rem;}.docblock h6{font-size:0.875rem;}.docblock{margin-left:24px;position:relative;}.docblock>:not(.more-examples-toggle):not(.example-wrap){max-width:100%;overflow-x:auto;}.out-of-band{flex-grow:0;font-size:1.125rem;}.docblock code,.docblock-short code,pre,.rustdoc.src .example-wrap{background-color:var(--code-block-background-color);}#main-content{position:relative;}.docblock table{margin:.5em 0;border-collapse:collapse;}.docblock table td,.docblock table th{padding:.5em;border:1px solid var(--border-color);}.docblock table tbody tr:nth-child(2n){background:var(--table-alt-row-background-color);}div.where{white-space:pre-wrap;font-size:0.875rem;}.item-info{display:block;margin-left:24px;}.item-info code{font-size:0.875rem;}#main-content>.item-info{margin-left:0;}nav.sub{flex-grow:1;flex-flow:row nowrap;margin:4px 0 25px 0;display:flex;align-items:center;}.search-form{position:relative;display:flex;height:34px;flex-grow:1;}.src nav.sub{margin:0 0 15px 0;}.section-header{display:block;position:relative;}.section-header:hover>.anchor,.impl:hover>.anchor,.trait-impl:hover>.anchor,.variant:hover>.anchor{display:initial;}.anchor{display:none;position:absolute;left:-0.5em;background:none !important;}.anchor.field{left:-5px;}.section-header>.anchor{left:-15px;padding-right:8px;}h2.section-header>.anchor{padding-right:6px;}a.doc-anchor{color:var(--main-color);display:none;position:absolute;left:-17px;padding-right:5px;padding-left:3px;}*:hover>.doc-anchor{display:block;}.top-doc>.docblock>*:first-child>.doc-anchor{display:none !important;}.main-heading a:hover,.example-wrap .rust a:hover,.all-items a:hover,.docblock a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover:not(.doc-anchor),.docblock-short a:not(.test-arrow):not(.scrape-help):not(.tooltip):hover,.item-info a{text-decoration:underline;}.crate.block li.current a{font-weight:500;}table,.item-table{overflow-wrap:break-word;}.item-table{display:table;padding:0;margin:0;}.item-table>li{display:table-row;}.item-table>li>div{display:table-cell;}.item-table>li>.item-name{padding-right:1.25rem;}.search-results-title{margin-top:0;white-space:nowrap;display:flex;align-items:baseline;}#crate-search-div{position:relative;min-width:5em;}#crate-search{min-width:115px;padding:0 23px 0 4px;max-width:100%;text-overflow:ellipsis;border:1px solid var(--border-color);border-radius:4px;outline:none;cursor:pointer;-moz-appearance:none;-webkit-appearance:none;text-indent:0.01px;background-color:var(--main-background-color);color:inherit;line-height:1.5;font-weight:500;}#crate-search:hover,#crate-search:focus{border-color:var(--crate-search-hover-border);}#crate-search-div::after{pointer-events:none;width:100%;height:100%;position:absolute;top:0;left:0;content:"";background-repeat:no-repeat;background-size:20px;background-position:calc(100% - 2px) 56%;background-image:url('data:image/svg+xml, \ ');filter:var(--crate-search-div-filter);}#crate-search-div:hover::after,#crate-search-div:focus-within::after{filter:var(--crate-search-div-hover-filter);}#crate-search>option{font-size:1rem;}.search-input{-webkit-appearance:none;outline:none;border:1px solid var(--border-color);border-radius:2px;padding:8px;font-size:1rem;flex-grow:1;background-color:var(--button-background-color);color:var(--search-color);}.search-input:focus{border-color:var(--search-input-focused-border-color);}.search-results{display:none;}.search-results.active{display:block;}.search-results>a{display:flex;margin-left:2px;margin-right:2px;border-bottom:1px solid var(--search-result-border-color);gap:1em;}.search-results>a>div.desc{white-space:nowrap;text-overflow:ellipsis;overflow:hidden;flex:2;}.search-results a:hover,.search-results a:focus{background-color:var(--search-result-link-focus-background-color);}.search-results .result-name{display:flex;align-items:center;justify-content:start;flex:3;}.search-results .result-name .alias{color:var(--search-results-alias-color);}.search-results .result-name .grey{color:var(--search-results-grey-color);}.search-results .result-name .typename{color:var(--search-results-grey-color);font-size:0.875rem;width:var(--search-typename-width);}.search-results .result-name .path{word-break:break-all;max-width:calc(100% - var(--search-typename-width));display:inline-block;}.search-results .result-name .path>*{display:inline;}.popover{position:absolute;top:100%;right:0;z-index:calc(var(--desktop-sidebar-z-index) + 1);margin-top:7px;border-radius:3px;border:1px solid var(--border-color);background-color:var(--main-background-color);color:var(--main-color);--popover-arrow-offset:11px;}.popover::before{content:'';position:absolute;right:var(--popover-arrow-offset);border:solid var(--border-color);border-width:1px 1px 0 0;background-color:var(--main-background-color);padding:4px;transform:rotate(-45deg);top:-5px;}.setting-line{margin:1.2em 0.6em;}.setting-radio input,.setting-check input{margin-right:0.3em;height:1.2rem;width:1.2rem;border:2px solid var(--settings-input-border-color);outline:none;-webkit-appearance:none;cursor:pointer;}.setting-radio input{border-radius:50%;}.setting-radio span,.setting-check span{padding-bottom:1px;}.setting-radio{margin-top:0.1em;margin-bottom:0.1em;min-width:3.8em;padding:0.3em;display:inline-flex;align-items:center;cursor:pointer;}.setting-radio+.setting-radio{margin-left:0.5em;}.setting-check{margin-right:20px;display:flex;align-items:center;cursor:pointer;}.setting-radio input:checked{box-shadow:inset 0 0 0 3px var(--main-background-color);background-color:var(--settings-input-color);}.setting-check input:checked{background-color:var(--settings-input-color);border-width:1px;content:url('data:image/svg+xml,\ \ - ');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{display:block;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji,.item-info .stab::before{font-size:1.25rem;}.stab .emoji{margin-right:0.3rem;}.item-info .stab::before{content:"\0";width:0;display:inline-block;color:transparent;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}.top-doc>.docblock>.warning:first-child::before{top:20px;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}.src-sidebar-title{position:sticky;top:0;display:flex;padding:8px 8px 0 48px;margin-bottom:7px;background:var(--sidebar-background-color);border-bottom:1px solid var(--border-color);}#settings-menu,#help-button{margin-left:4px;display:flex;}#sidebar-button{display:none;line-height:0;}.hide-sidebar #sidebar-button,.src #sidebar-button{display:flex;margin-right:4px;position:fixed;left:6px;height:34px;width:34px;background-color:var(--main-background-color);z-index:1;}.src #sidebar-button{left:8px;z-index:calc(var(--desktop-sidebar-z-index) + 1);}.hide-sidebar .src #sidebar-button{position:static;}#settings-menu>a,#help-button>a,#sidebar-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus,#sidebar-button>a:hover,#sidebar-button>a:focus{border-color:var(--settings-button-border-focus);}#sidebar-button>a:before{content:url('data:image/svg+xml,');}.setting-radio input:focus,.setting-check input:focus{box-shadow:0 0 1px 1px var(--settings-input-color);}.setting-radio input:checked:focus{box-shadow:inset 0 0 0 3px var(--main-background-color),0 0 2px 2px var(--settings-input-color);}.setting-radio input:hover,.setting-check input:hover{border-color:var(--settings-input-color) !important;}#help.popover{max-width:600px;--popover-arrow-offset:48px;}#help dt{float:left;clear:left;margin-right:0.5rem;}#help span.top,#help span.bottom{text-align:center;display:block;font-size:1.125rem;}#help span.top{margin:10px 0;border-bottom:1px solid var(--border-color);padding-bottom:4px;margin-bottom:6px;}#help span.bottom{clear:both;border-top:1px solid var(--border-color);}.side-by-side>div{width:50%;float:left;padding:0 20px 20px 17px;}.item-info .stab{display:block;padding:3px;margin-bottom:5px;}.item-name .stab{margin-left:0.3125em;}.stab{padding:0 2px;font-size:0.875rem;font-weight:normal;color:var(--main-color);background-color:var(--stab-background-color);width:fit-content;white-space:pre-wrap;border-radius:3px;display:inline;vertical-align:baseline;}.stab.portability>code{background:none;color:var(--stab-code-color);}.stab .emoji,.item-info .stab::before{font-size:1.25rem;}.stab .emoji{margin-right:0.3rem;}.item-info .stab::before{content:"\0";width:0;display:inline-block;color:transparent;}.emoji{text-shadow:1px 0 0 black,-1px 0 0 black,0 1px 0 black,0 -1px 0 black;}.since{font-weight:normal;font-size:initial;}.rightside{padding-left:12px;float:right;}.rightside:not(a),.out-of-band{color:var(--right-side-color);}pre.rust{tab-size:4;-moz-tab-size:4;}pre.rust .kw{color:var(--code-highlight-kw-color);}pre.rust .kw-2{color:var(--code-highlight-kw-2-color);}pre.rust .lifetime{color:var(--code-highlight-lifetime-color);}pre.rust .prelude-ty{color:var(--code-highlight-prelude-color);}pre.rust .prelude-val{color:var(--code-highlight-prelude-val-color);}pre.rust .string{color:var(--code-highlight-string-color);}pre.rust .number{color:var(--code-highlight-number-color);}pre.rust .bool-val{color:var(--code-highlight-literal-color);}pre.rust .self{color:var(--code-highlight-self-color);}pre.rust .attr{color:var(--code-highlight-attribute-color);}pre.rust .macro,pre.rust .macro-nonterminal{color:var(--code-highlight-macro-color);}pre.rust .question-mark{font-weight:bold;color:var(--code-highlight-question-mark-color);}pre.rust .comment{color:var(--code-highlight-comment-color);}pre.rust .doccomment{color:var(--code-highlight-doc-comment-color);}.rustdoc.src .example-wrap pre.rust a{background:var(--codeblock-link-background);}.example-wrap.compile_fail,.example-wrap.should_panic{border-left:2px solid var(--codeblock-error-color);}.ignore.example-wrap{border-left:2px solid var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover,.example-wrap.should_panic:hover{border-left:2px solid var(--codeblock-error-hover-color);}.example-wrap.ignore:hover{border-left:2px solid var(--codeblock-ignore-hover-color);}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip{color:var(--codeblock-error-color);}.example-wrap.ignore .tooltip{color:var(--codeblock-ignore-color);}.example-wrap.compile_fail:hover .tooltip,.example-wrap.should_panic:hover .tooltip{color:var(--codeblock-error-hover-color);}.example-wrap.ignore:hover .tooltip{color:var(--codeblock-ignore-hover-color);}.example-wrap .tooltip{position:absolute;display:block;left:-25px;top:5px;margin:0;line-height:1;}.example-wrap.compile_fail .tooltip,.example-wrap.should_panic .tooltip,.example-wrap.ignore .tooltip{font-weight:bold;font-size:1.25rem;}.content .docblock .warning{border-left:2px solid var(--warning-border-color);padding:14px;position:relative;overflow-x:visible !important;}.content .docblock .warning::before{color:var(--warning-border-color);content:"ⓘ";position:absolute;left:-25px;top:5px;font-weight:bold;font-size:1.25rem;}.top-doc>.docblock>.warning:first-child::before{top:20px;}a.test-arrow{visibility:hidden;position:absolute;padding:5px 10px 5px 10px;border-radius:5px;font-size:1.375rem;top:5px;right:5px;z-index:1;color:var(--test-arrow-color);background-color:var(--test-arrow-background-color);}a.test-arrow:hover{color:var(--test-arrow-hover-color);background-color:var(--test-arrow-hover-background-color);}.example-wrap:hover .test-arrow{visibility:visible;}.code-attribute{font-weight:300;color:var(--code-attribute-color);}.item-spacer{width:100%;height:12px;display:block;}.out-of-band>span.since{font-size:1.25rem;}.sub-variant h4{font-size:1rem;font-weight:400;margin-top:0;margin-bottom:0;}.sub-variant{margin-left:24px;margin-bottom:40px;}.sub-variant>.sub-variant-field{margin-left:24px;}:target{padding-right:3px;background-color:var(--target-background-color);border-right:3px solid var(--target-border-color);}.code-header a.tooltip{color:inherit;margin-right:15px;position:relative;}.code-header a.tooltip:hover{color:var(--link-color);}a.tooltip:hover::after{position:absolute;top:calc(100% - 10px);left:-15px;right:-15px;height:20px;content:"\00a0";}.fade-out{opacity:0;transition:opacity 0.45s cubic-bezier(0,0,0.1,1.0);}.popover.tooltip .content{margin:0.25em 0.5em;}.popover.tooltip .content pre,.popover.tooltip .content code{background:transparent;margin:0;padding:0;font-size:1.25rem;white-space:pre-wrap;}.popover.tooltip .content>h3:first-child{margin:0 0 5px 0;}.search-failed{text-align:center;margin-top:20px;display:none;}.search-failed.active{display:block;}.search-failed>ul{text-align:left;max-width:570px;margin-left:auto;margin-right:auto;}#search-tabs{display:flex;flex-direction:row;gap:1px;margin-bottom:4px;}#search-tabs button{text-align:center;font-size:1.125rem;border:0;border-top:2px solid;flex:1;line-height:1.5;color:inherit;}#search-tabs button:not(.selected){background-color:var(--search-tab-button-not-selected-background);border-top-color:var(--search-tab-button-not-selected-border-top-color);}#search-tabs button:hover,#search-tabs button.selected{background-color:var(--search-tab-button-selected-background);border-top-color:var(--search-tab-button-selected-border-top-color);}#search-tabs .count{font-size:1rem;font-variant-numeric:tabular-nums;color:var(--search-tab-title-count-color);}#search .error code{border-radius:3px;background-color:var(--search-error-code-background-color);}.search-corrections{font-weight:normal;}#src-sidebar{width:100%;overflow:auto;}#src-sidebar div.files>a:hover,details.dir-entry summary:hover,#src-sidebar div.files>a:focus,details.dir-entry summary:focus{background-color:var(--src-sidebar-background-hover);}#src-sidebar div.files>a.selected{background-color:var(--src-sidebar-background-selected);}.src-sidebar-title{position:sticky;top:0;display:flex;padding:8px 8px 0 48px;margin-bottom:7px;background:var(--sidebar-background-color);border-bottom:1px solid var(--border-color);}#settings-menu,#help-button{margin-left:4px;display:flex;}#sidebar-button{display:none;line-height:0;}.hide-sidebar #sidebar-button,.src #sidebar-button{display:flex;margin-right:4px;position:fixed;left:6px;height:34px;width:34px;background-color:var(--main-background-color);z-index:1;}.src #sidebar-button{left:8px;z-index:calc(var(--desktop-sidebar-z-index) + 1);}.hide-sidebar .src #sidebar-button{position:static;}#settings-menu>a,#help-button>a,#sidebar-button>a{display:flex;align-items:center;justify-content:center;background-color:var(--button-background-color);border:1px solid var(--border-color);border-radius:2px;color:var(--settings-button-color);font-size:20px;width:33px;}#settings-menu>a:hover,#settings-menu>a:focus,#help-button>a:hover,#help-button>a:focus,#sidebar-button>a:hover,#sidebar-button>a:focus{border-color:var(--settings-button-border-focus);}#settings-menu>a{line-height:0;font-size:0;}#settings-menu>a:before{content:url('data:image/svg+xml,\ + ');width:22px;height:22px;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ \ \ - ');width:22px;height:22px;}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;margin-left:10px;padding:0;padding-left:2px;border:0;width:33px;}#copy-path>img{filter:var(--copy-path-img-filter);}#copy-path:hover>img{filter:var(--copy-path-img-hover-filter);}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,');width:22px;height:22px;}#copy-path{color:var(--copy-path-button-color);background:var(--main-background-color);height:34px;width:33px;margin-left:10px;padding:0;padding-left:2px;border:0;font-size:0;}#copy-path::before{filter:var(--copy-path-img-filter);content:url('data:image/svg+xml,\ +\ +\ +');width:19px;height:18px;}#copy-path:hover::before{filter:var(--copy-path-img-hover-filter);}#copy-path.clicked::before{content:url('data:image/svg+xml,\ + \ + ');}@keyframes rotating{from{transform:rotate(0deg);}to{transform:rotate(360deg);}}#settings-menu.rotate>a img{animation:rotating 2s linear infinite;}kbd{display:inline-block;padding:3px 5px;font:15px monospace;line-height:10px;vertical-align:middle;border:solid 1px var(--border-color);border-radius:3px;color:var(--kbd-color);background-color:var(--kbd-background);box-shadow:inset 0 -1px 0 var(--kbd-box-shadow-color);}ul.all-items>li{list-style:none;}details.dir-entry{padding-left:4px;}details.dir-entry>summary{margin:0 0 0 -4px;padding:0 0 0 4px;cursor:pointer;}details.dir-entry div.folders,details.dir-entry div.files{padding-left:23px;}details.dir-entry a{display:block;}details.toggle{contain:layout;position:relative;}details.toggle>summary.hideme{cursor:pointer;font-size:1rem;}details.toggle>summary{list-style:none;outline:none;}details.toggle>summary::-webkit-details-marker,details.toggle>summary::marker{display:none;}details.toggle>summary.hideme>span{margin-left:9px;}details.toggle>summary::before{background:url('data:image/svg+xml,') no-repeat top left;content:"";cursor:pointer;width:16px;height:16px;display:inline-block;vertical-align:middle;opacity:.5;filter:var(--toggle-filter);}details.toggle>summary.hideme>span,.more-examples-toggle summary,.more-examples-toggle .hide-more{color:var(--toggles-color);}details.toggle>summary::after{content:"Expand";overflow:hidden;width:0;height:0;position:absolute;}details.toggle>summary.hideme::after{content:"";}details.toggle>summary:focus::before,details.toggle>summary:hover::before{opacity:1;}details.toggle>summary:focus-visible::before{outline:1px dotted #000;outline-offset:1px;}details.non-exhaustive{margin-bottom:8px;}details.toggle>summary.hideme::before{position:relative;}details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;top:4px;}.impl-items>details.toggle>summary:not(.hideme)::before{position:absolute;left:-24px;}details.toggle[open] >summary.hideme{position:absolute;}details.toggle[open] >summary.hideme>span{display:none;}details.toggle[open] >summary::before{background:url('data:image/svg+xml,') no-repeat top left;}details viewBox="0 0 22 22" fill="none" stroke="black">\ \ \ - ');opacity:0.75;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location,.sidebar-resizer{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.src .search-form{margin-left:40px;}.hide-sidebar .search-form{margin-left:32px;}.hide-sidebar .src .search-form{margin-left:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;}.mobile-topbar h2 a{display:block;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.hide-sidebar .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;border:none;line-height:0;}.hide-sidebar .sidebar-menu-toggle{display:none;}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#copy-path,#help-button{display:none;}#sidebar-button>a:before{content:url('data:image/svg+xml,');opacity:0.75;}@media (max-width:850px){#search-tabs .count{display:block;}}@media (max-width:700px){*[id]{scroll-margin-top:45px;}.rustdoc{display:block;}main{padding-left:15px;padding-top:0px;}.main-heading{flex-direction:column;}.out-of-band{text-align:left;margin-left:initial;padding:initial;}.out-of-band .since::before{content:"Since ";}.sidebar .logo-container,.sidebar .location,.sidebar-resizer{display:none;}.sidebar{position:fixed;top:45px;left:-1000px;z-index:11;height:calc(100vh - 45px);width:200px;}.src main,.rustdoc.src .sidebar{top:0;padding:0;height:100vh;border:0;}.src .search-form{margin-left:40px;}.hide-sidebar .search-form{margin-left:32px;}.hide-sidebar .src .search-form{margin-left:0;}.sidebar.shown,.src-sidebar-expanded .src .sidebar,.rustdoc:not(.src) .sidebar:focus-within{left:0;}.mobile-topbar h2{padding-bottom:0;margin:auto 0.5em auto auto;overflow:hidden;font-size:24px;white-space:nowrap;text-overflow:ellipsis;}.mobile-topbar .logo-container>img{max-width:35px;max-height:35px;margin:5px 0 5px 20px;}.mobile-topbar{display:flex;flex-direction:row;position:sticky;z-index:10;font-size:2rem;height:45px;width:100%;left:0;top:0;}.hide-sidebar .mobile-topbar{display:none;}.sidebar-menu-toggle{width:45px;border:none;line-height:0;}.hide-sidebar .sidebar-menu-toggle{display:none;}.sidebar-elems{margin-top:1em;}.anchor{display:none !important;}#main-content>details.toggle>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}#copy-path,#help-button{display:none;}#sidebar-button>a:before{content:url('data:image/svg+xml,\ \ \ - ');width:22px;height:22px;}.sidebar-menu-toggle:before{filter:var(--mobile-sidebar-menu-filter);}.sidebar-menu-toggle:hover{background:var(--main-background-color);}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{position:fixed;max-width:100vw;width:100vw;}.src .src-sidebar-title{padding-top:0;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"]{--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);--sidebar-resizer-hover:hsl(34,50%,33%);--sidebar-resizer-active:hsl(34,100%,66%);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar .current a,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img,:root[data-theme="ayu"] #sidebar-button>a:before{filter:invert(100);} \ No newline at end of file + ');width:22px;height:22px;}.sidebar-menu-toggle:before{filter:var(--mobile-sidebar-menu-filter);}.sidebar-menu-toggle:hover{background:var(--main-background-color);}.item-table,.item-row,.item-table>li,.item-table>li>div,.search-results>a,.search-results>a>div{display:block;}.search-results>a{padding:5px 0px;}.search-results>a>div.desc,.item-table>li>div.desc{padding-left:2em;}.search-results .result-name{display:block;}.search-results .result-name .typename{width:initial;margin-right:0;}.search-results .result-name .typename,.search-results .result-name .path{display:inline;}.src-sidebar-expanded .src .sidebar{position:fixed;max-width:100vw;width:100vw;}.src .src-sidebar-title{padding-top:0;}details.toggle:not(.top-doc)>summary{margin-left:10px;}.impl-items>details.toggle>summary:not(.hideme)::before,#main-content>details.toggle:not(.top-doc)>summary::before,#main-content>div>details.toggle>summary::before{left:-11px;}.impl-items>.item-info{margin-left:34px;}.src nav.sub{margin:0;padding:var(--nav-sub-mobile-padding);}}@media (min-width:701px){.scraped-example-title{position:absolute;z-index:10;background:var(--main-background-color);bottom:8px;right:5px;padding:2px 4px;box-shadow:0 0 4px var(--main-background-color);}}@media print{nav.sidebar,nav.sub,.out-of-band,a.src,#copy-path,details.toggle[open] >summary::before,details.toggle>summary::before,details.toggle.top-doc>summary{display:none;}.docblock{margin-left:0;}main{padding:10px;}}@media (max-width:464px){.docblock{margin-left:12px;}.docblock code{overflow-wrap:break-word;overflow-wrap:anywhere;}nav.sub{flex-direction:column;}.search-form{align-self:stretch;}}.variant,.implementors-toggle>summary,.impl,#implementors-list>.docblock,.impl-items>section,.impl-items>.toggle>summary,.methods>section,.methods>.toggle>summary{margin-bottom:0.75em;}.variants>.docblock,.implementors-toggle>.docblock,.impl-items>.toggle[open]:not(:last-child),.methods>.toggle[open]:not(:last-child),.implementors-toggle[open]:not(:last-child){margin-bottom:2em;}#trait-implementations-list .impl-items>.toggle:not(:last-child),#synthetic-implementations-list .impl-items>.toggle:not(:last-child),#blanket-implementations-list .impl-items>.toggle:not(:last-child){margin-bottom:1em;}.scraped-example-list .scrape-help{margin-left:10px;padding:0 4px;font-weight:normal;font-size:12px;position:relative;bottom:1px;border:1px solid var(--scrape-example-help-border-color);border-radius:50px;color:var(--scrape-example-help-color);}.scraped-example-list .scrape-help:hover{border-color:var(--scrape-example-help-hover-border-color);color:var(--scrape-example-help-hover-color);}.scraped-example{position:relative;}.scraped-example .code-wrapper{position:relative;display:flex;flex-direction:row;flex-wrap:wrap;width:100%;}.scraped-example:not(.expanded) .code-wrapper{max-height:calc(1.5em * 5 + 10px);}.scraped-example:not(.expanded) .code-wrapper pre{overflow-y:hidden;padding-bottom:0;max-height:calc(1.5em * 5 + 10px);}.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper,.more-scraped-examples .scraped-example:not(.expanded) .code-wrapper pre{max-height:calc(1.5em * 10 + 10px);}.scraped-example .code-wrapper .next,.scraped-example .code-wrapper .prev,.scraped-example .code-wrapper .expand{color:var(--main-color);position:absolute;top:0.25em;z-index:1;padding:0;background:none;border:none;-webkit-appearance:none;opacity:1;}.scraped-example .code-wrapper .prev{right:2.25em;}.scraped-example .code-wrapper .next{right:1.25em;}.scraped-example .code-wrapper .expand{right:0.25em;}.scraped-example:not(.expanded) .code-wrapper::before,.scraped-example:not(.expanded) .code-wrapper::after{content:" ";width:100%;height:5px;position:absolute;z-index:1;}.scraped-example:not(.expanded) .code-wrapper::before{top:0;background:linear-gradient(to bottom,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example:not(.expanded) .code-wrapper::after{bottom:0;background:linear-gradient(to top,var(--scrape-example-code-wrapper-background-start),var(--scrape-example-code-wrapper-background-end));}.scraped-example .code-wrapper .example-wrap{width:100%;overflow-y:hidden;margin-bottom:0;}.scraped-example:not(.expanded) .code-wrapper .example-wrap{overflow-x:hidden;}.scraped-example .example-wrap .rust span.highlight{background:var(--scrape-example-code-line-highlight);}.scraped-example .example-wrap .rust span.highlight.focus{background:var(--scrape-example-code-line-highlight-focus);}.more-examples-toggle{max-width:calc(100% + 25px);margin-top:10px;margin-left:-25px;}.more-examples-toggle .hide-more{margin-left:25px;cursor:pointer;}.more-scraped-examples{margin-left:25px;position:relative;}.toggle-line{position:absolute;top:5px;bottom:0;right:calc(100% + 10px);padding:0 4px;cursor:pointer;}.toggle-line-inner{min-width:2px;height:100%;background:var(--scrape-example-toggle-line-background);}.toggle-line:hover .toggle-line-inner{background:var(--scrape-example-toggle-line-hover-background);}.more-scraped-examples .scraped-example,.example-links{margin-top:20px;}.more-scraped-examples .scraped-example:first-child{margin-top:5px;}.example-links ul{margin-bottom:0;}:root[data-theme="light"],:root:not([data-theme]){--main-background-color:white;--main-color:black;--settings-input-color:#2196f3;--settings-input-border-color:#717171;--settings-button-color:#000;--settings-button-border-focus:#717171;--sidebar-background-color:#f5f5f5;--sidebar-background-color-hover:#e0e0e0;--code-block-background-color:#f5f5f5;--scrollbar-track-background-color:#dcdcdc;--scrollbar-thumb-background-color:rgba(36,37,39,0.6);--scrollbar-color:rgba(36,37,39,0.6) #d9d9d9;--headings-border-bottom-color:#ddd;--border-color:#e0e0e0;--button-background-color:#fff;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:none;--mobile-sidebar-menu-filter:none;--search-input-focused-border-color:#66afe9;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(35%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ad378a;--trait-link-color:#6e4fc9;--assoc-item-link-color:#3873ad;--function-link-color:#ad7c37;--macro-link-color:#068000;--keyword-link-color:#3873ad;--mod-link-color:#3873ad;--link-color:#3873ad;--sidebar-link-color:#356da4;--sidebar-current-link-background-color:#fff;--search-result-link-focus-background-color:#ccc;--search-result-border-color:#aaa3;--search-color:#000;--search-error-code-background-color:#d0cccc;--search-results-alias-color:#000;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#e6e6e6;--search-tab-button-not-selected-background:#e6e6e6;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#fff;--stab-background-color:#fff5d6;--stab-code-color:#000;--code-highlight-kw-color:#8959a8;--code-highlight-kw-2-color:#4271ae;--code-highlight-lifetime-color:#b76514;--code-highlight-prelude-color:#4271ae;--code-highlight-prelude-val-color:#c82829;--code-highlight-number-color:#718c00;--code-highlight-string-color:#718c00;--code-highlight-literal-color:#c82829;--code-highlight-attribute-color:#c82829;--code-highlight-self-color:#c82829;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8e908c;--code-highlight-doc-comment-color:#4d4d4c;--src-line-numbers-span-color:#c67e2d;--src-line-number-highlighted-background-color:#fdffd3;--test-arrow-color:#f5f5f5;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#f5f5f5;--test-arrow-hover-background-color:rgb(78,139,202);--target-background-color:#fdffd3;--target-border-color:#ad7c37;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:initial;--crate-search-div-filter:invert(100%) sepia(0%) saturate(4223%) hue-rotate(289deg) brightness(114%) contrast(76%);--crate-search-div-hover-filter:invert(44%) sepia(18%) saturate(23%) hue-rotate(317deg) brightness(96%) contrast(93%);--crate-search-hover-border:#717171;--src-sidebar-background-selected:#fff;--src-sidebar-background-hover:#e0e0e0;--table-alt-row-background-color:#f5f5f5;--codeblock-link-background:#eee;--scrape-example-toggle-line-background:#ccc;--scrape-example-toggle-line-hover-background:#999;--scrape-example-code-line-highlight:#fcffd6;--scrape-example-code-line-highlight-focus:#f6fdb0;--scrape-example-help-border-color:#555;--scrape-example-help-color:#333;--scrape-example-help-hover-border-color:#000;--scrape-example-help-hover-color:#000;--scrape-example-code-wrapper-background-start:rgba(255,255,255,1);--scrape-example-code-wrapper-background-end:rgba(255,255,255,0);--sidebar-resizer-hover:hsl(207,90%,66%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="dark"]{--main-background-color:#353535;--main-color:#ddd;--settings-input-color:#2196f3;--settings-input-border-color:#999;--settings-button-color:#000;--settings-button-border-focus:#ffb900;--sidebar-background-color:#505050;--sidebar-background-color-hover:#676767;--code-block-background-color:#2A2A2A;--scrollbar-track-background-color:#717171;--scrollbar-thumb-background-color:rgba(32,34,37,.6);--scrollbar-color:rgba(32,34,37,.6) #5a5a5a;--headings-border-bottom-color:#d2d2d2;--border-color:#e0e0e0;--button-background-color:#f0f0f0;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#008dfd;--copy-path-button-color:#999;--copy-path-img-filter:invert(50%);--copy-path-img-hover-filter:invert(65%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#2dbfb8;--trait-link-color:#b78cf2;--assoc-item-link-color:#d2991d;--function-link-color:#2bab63;--macro-link-color:#09bd00;--keyword-link-color:#d2991d;--mod-link-color:#d2991d;--link-color:#d2991d;--sidebar-link-color:#fdbf35;--sidebar-current-link-background-color:#444;--search-result-link-focus-background-color:#616161;--search-result-border-color:#aaa3;--search-color:#111;--search-error-code-background-color:#484848;--search-results-alias-color:#fff;--search-results-grey-color:#ccc;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:#252525;--search-tab-button-not-selected-background:#252525;--search-tab-button-selected-border-top-color:#0089ff;--search-tab-button-selected-background:#353535;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ab8ac1;--code-highlight-kw-2-color:#769acb;--code-highlight-lifetime-color:#d97f26;--code-highlight-prelude-color:#769acb;--code-highlight-prelude-val-color:#ee6868;--code-highlight-number-color:#83a300;--code-highlight-string-color:#83a300;--code-highlight-literal-color:#ee6868;--code-highlight-attribute-color:#ee6868;--code-highlight-self-color:#ee6868;--code-highlight-macro-color:#3e999f;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#8d8d8b;--code-highlight-doc-comment-color:#8ca375;--src-line-numbers-span-color:#3b91e2;--src-line-number-highlighted-background-color:#0a042f;--test-arrow-color:#dedede;--test-arrow-background-color:rgba(78,139,202,0.2);--test-arrow-hover-color:#dedede;--test-arrow-hover-background-color:#4e8bca;--target-background-color:#494a3d;--target-border-color:#bb7410;--kbd-color:#000;--kbd-background:#fafbfc;--kbd-box-shadow-color:#c6cbd1;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(94%) sepia(0%) saturate(721%) hue-rotate(255deg) brightness(90%) contrast(90%);--crate-search-div-hover-filter:invert(69%) sepia(60%) saturate(6613%) hue-rotate(184deg) brightness(100%) contrast(91%);--crate-search-hover-border:#2196f3;--src-sidebar-background-selected:#333;--src-sidebar-background-hover:#444;--table-alt-row-background-color:#2a2a2a;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(53,53,53,1);--scrape-example-code-wrapper-background-end:rgba(53,53,53,0);--sidebar-resizer-hover:hsl(207,30%,54%);--sidebar-resizer-active:hsl(207,90%,54%);}:root[data-theme="ayu"]{--main-background-color:#0f1419;--main-color:#c5c5c5;--settings-input-color:#ffb454;--settings-input-border-color:#999;--settings-button-color:#fff;--settings-button-border-focus:#e0e0e0;--sidebar-background-color:#14191f;--sidebar-background-color-hover:rgba(70,70,70,0.33);--code-block-background-color:#191f26;--scrollbar-track-background-color:transparent;--scrollbar-thumb-background-color:#5c6773;--scrollbar-color:#5c6773 #24292f;--headings-border-bottom-color:#5c6773;--border-color:#5c6773;--button-background-color:#141920;--right-side-color:grey;--code-attribute-color:#999;--toggles-color:#999;--toggle-filter:invert(100%);--mobile-sidebar-menu-filter:invert(100%);--search-input-focused-border-color:#5c6773;--copy-path-button-color:#fff;--copy-path-img-filter:invert(70%);--copy-path-img-hover-filter:invert(100%);--codeblock-error-hover-color:rgb(255,0,0);--codeblock-error-color:rgba(255,0,0,.5);--codeblock-ignore-hover-color:rgb(255,142,0);--codeblock-ignore-color:rgba(255,142,0,.6);--warning-border-color:#ff8e00;--type-link-color:#ffa0a5;--trait-link-color:#39afd7;--assoc-item-link-color:#39afd7;--function-link-color:#fdd687;--macro-link-color:#a37acc;--keyword-link-color:#39afd7;--mod-link-color:#39afd7;--link-color:#39afd7;--sidebar-link-color:#53b1db;--sidebar-current-link-background-color:transparent;--search-result-link-focus-background-color:#3c3c3c;--search-result-border-color:#aaa3;--search-color:#fff;--search-error-code-background-color:#4f4c4c;--search-results-alias-color:#c5c5c5;--search-results-grey-color:#999;--search-tab-title-count-color:#888;--search-tab-button-not-selected-border-top-color:none;--search-tab-button-not-selected-background:transparent !important;--search-tab-button-selected-border-top-color:none;--search-tab-button-selected-background:#141920 !important;--stab-background-color:#314559;--stab-code-color:#e6e1cf;--code-highlight-kw-color:#ff7733;--code-highlight-kw-2-color:#ff7733;--code-highlight-lifetime-color:#ff7733;--code-highlight-prelude-color:#69f2df;--code-highlight-prelude-val-color:#ff7733;--code-highlight-number-color:#b8cc52;--code-highlight-string-color:#b8cc52;--code-highlight-literal-color:#ff7733;--code-highlight-attribute-color:#e6e1cf;--code-highlight-self-color:#36a3d9;--code-highlight-macro-color:#a37acc;--code-highlight-question-mark-color:#ff9011;--code-highlight-comment-color:#788797;--code-highlight-doc-comment-color:#a1ac88;--src-line-numbers-span-color:#5c6773;--src-line-number-highlighted-background-color:rgba(255,236,164,0.06);--test-arrow-color:#788797;--test-arrow-background-color:rgba(57,175,215,0.09);--test-arrow-hover-color:#c5c5c5;--test-arrow-hover-background-color:rgba(57,175,215,0.368);--target-background-color:rgba(255,236,164,0.06);--target-border-color:rgba(255,180,76,0.85);--kbd-color:#c5c5c5;--kbd-background:#314559;--kbd-box-shadow-color:#5c6773;--rust-logo-filter:drop-shadow(1px 0 0px #fff) drop-shadow(0 1px 0 #fff) drop-shadow(-1px 0 0 #fff) drop-shadow(0 -1px 0 #fff);--crate-search-div-filter:invert(41%) sepia(12%) saturate(487%) hue-rotate(171deg) brightness(94%) contrast(94%);--crate-search-div-hover-filter:invert(98%) sepia(12%) saturate(81%) hue-rotate(343deg) brightness(113%) contrast(76%);--crate-search-hover-border:#e0e0e0;--src-sidebar-background-selected:#14191f;--src-sidebar-background-hover:#14191f;--table-alt-row-background-color:#191f26;--codeblock-link-background:#333;--scrape-example-toggle-line-background:#999;--scrape-example-toggle-line-hover-background:#c5c5c5;--scrape-example-code-line-highlight:#5b3b01;--scrape-example-code-line-highlight-focus:#7c4b0f;--scrape-example-help-border-color:#aaa;--scrape-example-help-color:#eee;--scrape-example-help-hover-border-color:#fff;--scrape-example-help-hover-color:#fff;--scrape-example-code-wrapper-background-start:rgba(15,20,25,1);--scrape-example-code-wrapper-background-end:rgba(15,20,25,0);--sidebar-resizer-hover:hsl(34,50%,33%);--sidebar-resizer-active:hsl(34,100%,66%);}:root[data-theme="ayu"] h1,:root[data-theme="ayu"] h2,:root[data-theme="ayu"] h3,:root[data-theme="ayu"] h4,:where(:root[data-theme="ayu"]) h1 a,:root[data-theme="ayu"] .sidebar h2 a,:root[data-theme="ayu"] .sidebar h3 a{color:#fff;}:root[data-theme="ayu"] .docblock code{color:#ffb454;}:root[data-theme="ayu"] .docblock a>code{color:#39AFD7 !important;}:root[data-theme="ayu"] .code-header,:root[data-theme="ayu"] .docblock pre>code,:root[data-theme="ayu"] pre,:root[data-theme="ayu"] pre>code,:root[data-theme="ayu"] .item-info code,:root[data-theme="ayu"] .rustdoc.source .example-wrap{color:#e6e1cf;}:root[data-theme="ayu"] .sidebar .current,:root[data-theme="ayu"] .sidebar .current a,:root[data-theme="ayu"] .sidebar a:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:hover,:root[data-theme="ayu"] details.dir-entry summary:hover,:root[data-theme="ayu"] #src-sidebar div.files>a:focus,:root[data-theme="ayu"] details.dir-entry summary:focus,:root[data-theme="ayu"] #src-sidebar div.files>a.selected{color:#ffb44c;}:root[data-theme="ayu"] .sidebar-elems .location{color:#ff7733;}:root[data-theme="ayu"] .src-line-numbers .line-highlighted{color:#708090;padding-right:7px;border-right:1px solid #ffb44c;}:root[data-theme="ayu"] .search-results a:hover,:root[data-theme="ayu"] .search-results a:focus{color:#fff !important;background-color:#3c3c3c;}:root[data-theme="ayu"] .search-results a{color:#0096cf;}:root[data-theme="ayu"] .search-results a div.desc{color:#c5c5c5;}:root[data-theme="ayu"] .result-name .primitive>i,:root[data-theme="ayu"] .result-name .keyword>i{color:#788797;}:root[data-theme="ayu"] #search-tabs>button.selected{border-bottom:1px solid #ffb44c !important;border-top:none;}:root[data-theme="ayu"] #search-tabs>button:not(.selected){border:none;background-color:transparent !important;}:root[data-theme="ayu"] #search-tabs>button:hover{border-bottom:1px solid rgba(242,151,24,0.3);}:root[data-theme="ayu"] #settings-menu>a img,:root[data-theme="ayu"] #sidebar-button>a:before{filter:invert(100);} \ No newline at end of file diff --git a/ch5/static.files/search-bf21c90c8c1d92b1.js b/ch5/static.files/search-bf21c90c8c1d92b1.js new file mode 100644 index 00000000..81d04e0e --- /dev/null +++ b/ch5/static.files/search-bf21c90c8c1d92b1.js @@ -0,0 +1,5 @@ +"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");const TY_IMPORT=itemTypes.indexOf("import");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";const UNBOXING_LIMIT=5;function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost,);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1,)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let searchIndexDeprecated;let searchIndexEmptyDesc;let functionTypeFingerprint;let currentResults;const typeNameIdMap=new Map();const ALIASES=new Map();const typeNameIdOfArray=buildTypeMapIndex("array");const typeNameIdOfSlice=buildTypeMapIndex("slice");const typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");const typeNameIdOfTuple=buildTypeMapIndex("tuple");const typeNameIdOfUnit=buildTypeMapIndex("unit");const typeNameIdOfTupleOrUnit=buildTypeMapIndex("()");const typeNameIdOfFn=buildTypeMapIndex("fn");const typeNameIdOfFnMut=buildTypeMapIndex("fnmut");const typeNameIdOfFnOnce=buildTypeMapIndex("fnonce");const typeNameIdOfHof=buildTypeMapIndex("->");function buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){const obj=typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return makePrimitiveElement("never",{bindingName})}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){if(gen.name!==null){gen.bindingName.generics.unshift(gen)}bindings.set(gen.bindingName.name,gen.bindingName.generics);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}else{throw["Unexpected ",c]}}parserState.pos+=1;end=parserState.pos}if(foundExclamation!==-1&&foundExclamation!==start&&isIdentCharacter(parserState.userQuery[foundExclamation-1])){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=foundExclamation}return end}function getFilteredNextElem(query,parserState,elems,isInGenerics){const start=parserState.pos;if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){throw["Expected type filter before ",":"]}getNextElem(query,parserState,elems,isInGenerics);if(parserState.userQuery[parserState.pos]===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}if(elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;getNextElem(query,parserState,elems,isInGenerics)}}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const bindingName=parserState.isInBinding;parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else if(name==="()"&&generics.length===1&&generics[0].name==="->"){generics[0].typeFilter=typeFilter;elems.push(generics[0])}else{if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push(makePrimitiveElement(name,{bindingName,generics}))}}else{const isStringElem=parserState.userQuery[start]==="\"";if(isStringElem){start+=1;getStringElem(query,parserState,isInGenerics);end=parserState.pos-1}else{end=getIdentEndPosition(parserState)}if(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}else if(parserState.pos=end){throw["Found generics without a path"]}if(parserState.isInBinding){throw["Unexpected ","("," after ","="]}parserState.pos+=1;const typeFilter=parserState.typeFilter;parserState.typeFilter=null;getItemsBefore(query,parserState,generics,")");skipWhitespace(parserState);if(isReturnArrow(parserState)){parserState.pos+=2;skipWhitespace(parserState);getFilteredNextElem(query,parserState,generics,isInGenerics);generics[generics.length-1].bindingName=makePrimitiveElement("output")}else{generics.push(makePrimitiveElement(null,{bindingName:makePrimitiveElement("output"),typeFilter:null,}))}parserState.typeFilter=typeFilter}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics,),)}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let hofParameters=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"," after ","="]}hofParameters=[...elems];elems.length=0;parserState.pos+=2;foundStopChar=true;foundSeparator=false;continue}else if(c===" "){parserState.pos+=1;continue}else if(isSeparatorCharacter(c)){parserState.pos+=1;foundStopChar=true;foundSeparator=true;continue}else if(c===":"&&isPathStart(parserState)){throw["Unexpected ","::",": paths cannot start with ","::"]}else if(isEndCharacter(c)){throw["Unexpected ",c," after ",extra]}if(!foundStopChar){let extra=[];if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;getFilteredNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;if(hofParameters){foundSeparator=false;if([...elems,...hofParameters].some(x=>x.bindingName)||parserState.isInBinding){throw["Unexpected ","="," within ","->"]}const hofElem=makePrimitiveElement("->",{generics:hofParameters,bindings:new Map([["output",[...elems]]]),typeFilter:null,});elems.length=0;elems[0]=hofElem}parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;getFilteredNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&rawSearchIndex.has(elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}async function execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=res[2]+"|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}if(obj.ty===TY_IMPORT&&duplicates.has(res[2])){continue}if(duplicates.has(res[2]+"|"+TY_IMPORT)){continue}duplicates.add(obj.fullPath);duplicates.add(res[2]);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}async function sortResults(results,isType,preferredCrate){const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.item=searchIndex[result.id];result.word=searchIndex[result.id].word;result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=searchIndexDeprecated.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexDeprecated.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=searchIndexEmptyDesc.get(aaa.item.crate).contains(aaa.item.bitIndex);b=searchIndexEmptyDesc.get(bbb.item.crate).contains(bbb.item.bitIndex);if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,)){return true}}else if(unifyFunctionTypes([...fnType.generics,...Array.from(fnType.bindings.values()).flat()],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb,unboxingDepth+1,)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch,unboxingDepth,);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb,unboxingDepth,);if(passesUnification){return true}}return false},unboxingDepth,);if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth+1,)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb,unboxingDepth+1,);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(queryElem.id===typeNameIdOfTupleOrUnit&&(fnType.id===typeNameIdOfTuple||fnType.id===typeNameIdOfUnit)){}else if(queryElem.id===typeNameIdOfHof&&(fnType.id===typeNameIdOfFn||fnType.id===typeNameIdOfFnMut||fnType.id===typeNameIdOfFnOnce)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false},unboxingDepth,);return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens,unboxingDepth,){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp,unboxingDepth,)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens,unboxingDepth,)}return false}function checkIfInList(list,elem,whereClause,mgens,unboxingDepth){for(const entry of list){if(checkType(entry,elem,whereClause,mgens,unboxingDepth)){return true}}return false}function checkType(row,elem,whereClause,mgens,unboxingDepth){if(unboxingDepth>=UNBOXING_LIMIT){return false}if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0&&mgens===null){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth+1,)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice&&elem.id!==typeNameIdOfTupleOrUnit&&elem.id!==typeNameIdOfHof){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens,unboxingDepth,)}}return unifyFunctionTypes([row],[elem],whereClause,mgens,null,unboxingDepth)}function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3,);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,descShard:item.descShard,descIndex:item.descIndex,exactPath:item.exactPath,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,bitIndex:item.bitIndex,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance,){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let path_dist=0;const fullId=row.id;const tfpDist=compareTypeFingerprints(fullId,parsedQuery.typeFingerprint,);if(tfpDist!==null){const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause,null,0);const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause,null,0);if(in_args){results_in_args.max_dist=Math.max(results_in_args.max_dist||0,tfpDist);const maxDist=results_in_args.sizenormalizedIndex&&normalizedIndex!==-1)){index=normalizedIndex}if(elem.fullPath.length>1){path_dist=checkPath(elem.pathWithoutLast,row);if(path_dist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance);if(index===-1&&dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint,);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens,null,0,)},0,)){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}function innerRunQuery(){const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem,isAssocType){if(typeNameIdMap.has(elem.normalizedPathLast)&&(isAssocType||!typeNameIdMap.get(elem.normalizedPathLast).assocOnly)){elem.id=typeNameIdMap.get(elem.normalizedPathLast).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=editDistance(name,elem.normalizedPathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name).id,constraints]}),)}const fps=new Set();for(const elem of parsedQuery.elems){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}for(const elem of parsedQuery.returned){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}if(parsedQuery.foundElems===1&&parsedQuery.returned.length===0){if(parsedQuery.elems.length===1){const elem=parsedQuery.elems[0];for(let i=0,nSearchIndex=searchIndex.length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=searchIndex.length;i{const descs=await Promise.all(list.map(result=>{return searchIndexEmptyDesc.get(result.crate).contains(result.bitIndex)?"":searchState.loadDesc(result)}));for(const[i,result]of list.entries()){result.desc=descs[i]}}));if(parsedQuery.error!==null&&ret.others.length!==0){ret.query.error=null}return ret}function nextTab(direction){const next=(searchState.currentTab+direction+3)%searchState.focusedByTab.length;searchState.focusedByTab[searchState.currentTab]=document.activeElement;printTab(next);focusSearchResult()}function focusSearchResult(){const target=searchState.focusedByTab[searchState.currentTab]||document.querySelectorAll(".search-results.active a").item(0)||document.querySelectorAll("#search-tabs button").item(searchState.currentTab);searchState.focusedByTab[searchState.currentTab]=null;if(target){target.focus()}}function buildHrefAndPath(item){let displayPath;let href;const type=itemTypes[item.ty];const name=item.name;let path=item.path;let exactPath=item.exactPath;if(type==="mod"){displayPath=path+"::";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+name+"/index.html"}else if(type==="import"){displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/index.html#reexport."+name}else if(type==="primitive"||type==="keyword"){displayPath="";href=ROOT_PATH+path.replace(/::/g,"/")+"/"+type+"."+name+".html"}else if(type==="externcrate"){displayPath="";href=ROOT_PATH+name+"/index.html"}else if(item.parent!==undefined){const myparent=item.parent;let anchor=type+"."+name;const parentType=itemTypes[myparent.ty];let pageType=parentType;let pageName=myparent.name;exactPath=`${myparent.exactPath}::${myparent.name}`;if(parentType==="primitive"){displayPath=myparent.name+"::"}else if(type==="structfield"&&parentType==="variant"){const enumNameIdx=item.path.lastIndexOf("::");const enumName=item.path.substr(enumNameIdx+2);path=item.path.substr(0,enumNameIdx);displayPath=path+"::"+enumName+"::"+myparent.name+"::";anchor="variant."+myparent.name+".field."+name;pageType="enum";pageName=enumName}else{displayPath=path+"::"+myparent.name+"::"}if(item.implDisambiguator!==null){anchor=item.implDisambiguator+"/"+anchor}href=ROOT_PATH+path.replace(/::/g,"/")+"/"+pageType+"."+pageName+".html#"+anchor}else{displayPath=item.path+"::";href=ROOT_PATH+item.path.replace(/::/g,"/")+"/"+type+"."+name+".html"}return[displayPath,href,`${exactPath}::${name}`]}function pathSplitter(path){const tmp=""+path.replace(/::/g,"::");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}async function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement("div");if(array.length>0){output.className="search-results "+extraClass;for(const item of array){const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ +${item.alias} - see \ +
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ +${item.displayPath}${name}\ +
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)}}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,array.length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}async function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const[ret_others,ret_in_args,ret_returned]=await Promise.all([addTab(results.others,results.query,true),addTab(results.in_args,results.query,false),addTab(results.returned,results.query,false),]);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}async function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));await showResults(await execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.length>0?types.map(type=>buildItemSearchType(type,lowercasePaths)):EMPTY_GENERICS_ARRAY}const EMPTY_BINDINGS_MAP=new Map();const EMPTY_GENERICS_ARRAY=[];let TYPES_POOL=new Map();function buildItemSearchType(type,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=EMPTY_GENERICS_ARRAY;bindings=EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths,);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths,true).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,ty:TY_GENERIC,path:null,exactPath:null,generics,bindings,}}else if(pathIndex===0){result={id:null,ty:null,path:null,exactPath:null,generics,bindings,}}else{const item=lowercasePaths[pathIndex-1];result={id:buildTypeMapIndex(item.name,isAssocType),ty:item.ty,path:item.path,exactPath:item.exactPath,generics,bindings,}}const cr=TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty){return cr}}TYPES_POOL.set(result.id,result);return result}function buildFunctionSearchTypeCallback(lowercasePaths){return functionSearchType=>{if(functionSearchType===0){return null}const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths,)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths,)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));fps.add(input)}for(const g of type.generics){buildFunctionTypeFingerprint(g,output,fps)}const fb={id:null,ty:0,generics:EMPTY_GENERICS_ARRAY,bindings:EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;buildFunctionTypeFingerprint(fb,output,fps)}output[3]=fps.size}function compareTypeFingerprints(fullId,queryFingerprint){const fh0=functionTypeFingerprint[fullId*4];const fh1=functionTypeFingerprint[(fullId*4)+1];const fh2=functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return functionTypeFingerprint[(fullId*4)+3]}class VlqHexDecoder{constructor(string,cons){this.string=string;this.cons=cons;this.offset=0;this.backrefQueue=[]}decodeList(){const cb="}".charCodeAt(0);let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==cb){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){const[ob,la]=["{","`"].map(c=>c.charCodeAt(0));let n=0;let c=this.string.charCodeAt(this.offset);if(c===ob){this.offset+=1;return this.decodeList()}while(c>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);const[zero,ua,la]=["0","@","`"].map(c=>c.charCodeAt(0));if(c>=zero&&c16){this.backrefQueue.pop()}return result}}class RoaringBitmap{constructor(str){const strdecoded=atob(str);const u8array=new Uint8Array(strdecoded.length);for(let j=0;j=4){offsets=[];for(let j=0;j>3]&(1<<(j&0x7))){const runcount=(u8array[i]|(u8array[i+1]<<8));i+=2;this.containers.push(new RoaringBitmapRun(runcount,u8array.slice(i,i+(runcount*4)),));i+=runcount*4}else if(this.cardinalities[j]>=4096){this.containers.push(new RoaringBitmapBits(u8array.slice(i,i+8192)));i+=8192}else{const end=this.cardinalities[j]*2;this.containers.push(new RoaringBitmapArray(this.cardinalities[j],u8array.slice(i,i+end),));i+=end}}}contains(keyvalue){const key=keyvalue>>16;const value=keyvalue&0xFFFF;for(let i=0;i=start&&value<=(start+lenm1)){return true}}return false}}class RoaringBitmapArray{constructor(cardinality,array){this.cardinality=cardinality;this.array=array}contains(value){const l=this.cardinality*2;for(let i=0;i>3]&(1<<(value&7)))}}function buildIndex(rawSearchIndex){searchIndex=[];searchIndexDeprecated=new Map();searchIndexEmptyDesc=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;for(const crate of rawSearchIndex.values()){id+=crate.t.length+1}functionTypeFingerprint=new Uint32Array((id+1)*4);id=0;for(const[crate,crateCorpus]of rawSearchIndex){const itemDescShardDecoder=new VlqHexDecoder(crateCorpus.D,noop=>noop);let descShard={crate,shard:0,start:0,len:itemDescShardDecoder.next(),promise:null,resolve:null,};const descShardList=[descShard];searchIndexDeprecated.set(crate,new RoaringBitmap(crateCorpus.c));searchIndexEmptyDesc.set(crate,new RoaringBitmap(crateCorpus.e));let descIndex=0;const crateRow={crate,ty:3,name:crate,path:"",descShard,descIndex,exactPath:"",desc:crateCorpus.doc,parent:undefined,type:null,id,word:crate,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),bitIndex:0,implDisambiguator:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;if(!searchIndexEmptyDesc.get(crate).contains(0)){descIndex+=1}const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemReexports=new Map(crateCorpus.r);const itemParentIdxs=crateCorpus.i;const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];const itemFunctionDecoder=new VlqHexDecoder(crateCorpus.f,buildFunctionSearchTypeCallback(lowercasePaths),);let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}const exactPath=elem.length>3?itemPaths.get(elem[3]):path;lowercasePaths.push({ty,name:name.toLowerCase(),path,exactPath});paths[i]={ty,name,path,exactPath}}lastPath="";len=itemTypes.length;for(let i=0;i=descShard.len&&!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descShard={crate,shard:descShard.shard+1,start:descShard.start+descShard.len,len:itemDescShardDecoder.next(),promise:null,resolve:null,};descIndex=0;descShardList.push(descShard)}let word="";if(typeof itemNames[i]==="string"){word=itemNames[i].toLowerCase()}const path=itemPaths.has(i)?itemPaths.get(i):lastPath;const type=itemFunctionDecoder.next();if(type!==null){if(type){const fp=functionTypeFingerprint.subarray(id*4,(id+1)*4);const fps=new Set();for(const t of type.inputs){buildFunctionTypeFingerprint(t,fp,fps)}for(const t of type.output){buildFunctionTypeFingerprint(t,fp,fps)}for(const w of type.where_clause){for(const t of w){buildFunctionTypeFingerprint(t,fp,fps)}}}}const row={crate,ty:itemTypes.charCodeAt(i)-charA,name:itemNames[i],path,descShard,descIndex,exactPath:itemReexports.has(i)?itemPaths.get(itemReexports.get(i)):path,parent:itemParentIdxs[i]>0?paths[itemParentIdxs[i]-1]:undefined,type,id,word,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),bitIndex,implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path;if(!searchIndexEmptyDesc.get(crate).contains(bitIndex)){descIndex+=1}}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length;searchState.descShards.set(crate,descShardList)}TYPES_POOL=new Map()}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}})() \ No newline at end of file diff --git a/ch5/static.files/search-dd67cee4cfa65049.js b/ch5/static.files/search-dd67cee4cfa65049.js deleted file mode 100644 index ef8bf865..00000000 --- a/ch5/static.files/search-dd67cee4cfa65049.js +++ /dev/null @@ -1,5 +0,0 @@ -"use strict";if(!Array.prototype.toSpliced){Array.prototype.toSpliced=function(){const me=this.slice();Array.prototype.splice.apply(me,arguments);return me}}(function(){const itemTypes=["keyword","primitive","mod","externcrate","import","struct","enum","fn","type","static","trait","impl","tymethod","method","structfield","variant","macro","associatedtype","constant","associatedconstant","union","foreigntype","existential","attr","derive","traitalias","generic",];const longItemTypes=["keyword","primitive type","module","extern crate","re-export","struct","enum","function","type alias","static","trait","","trait method","method","struct field","enum variant","macro","assoc type","constant","assoc const","union","foreign type","existential type","attribute macro","derive macro","trait alias",];const TY_GENERIC=itemTypes.indexOf("generic");const ROOT_PATH=typeof window!=="undefined"?window.rootPath:"../";function printTab(nb){let iter=0;let foundCurrentTab=false;let foundCurrentResultSet=false;onEachLazy(document.getElementById("search-tabs").childNodes,elem=>{if(nb===iter){addClass(elem,"selected");foundCurrentTab=true}else{removeClass(elem,"selected")}iter+=1});const isTypeSearch=(nb>0||iter===1);iter=0;onEachLazy(document.getElementById("results").childNodes,elem=>{if(nb===iter){addClass(elem,"active");foundCurrentResultSet=true}else{removeClass(elem,"active")}iter+=1});if(foundCurrentTab&&foundCurrentResultSet){searchState.currentTab=nb;const correctionsElem=document.getElementsByClassName("search-corrections");if(isTypeSearch){removeClass(correctionsElem[0],"hidden")}else{addClass(correctionsElem[0],"hidden")}}else if(nb!==0){printTab(0)}}const editDistanceState={current:[],prev:[],prevPrev:[],calculate:function calculate(a,b,limit){if(a.lengthlimit){return limit+1}while(b.length>0&&b[0]===a[0]){a=a.substring(1);b=b.substring(1)}while(b.length>0&&b[b.length-1]===a[a.length-1]){a=a.substring(0,a.length-1);b=b.substring(0,b.length-1)}if(b.length===0){return minDist}const aLength=a.length;const bLength=b.length;for(let i=0;i<=bLength;++i){this.current[i]=0;this.prev[i]=i;this.prevPrev[i]=Number.MAX_VALUE}for(let i=1;i<=aLength;++i){this.current[0]=i;const aIdx=i-1;for(let j=1;j<=bLength;++j){const bIdx=j-1;const substitutionCost=a[aIdx]===b[bIdx]?0:1;this.current[j]=Math.min(this.prev[j]+1,this.current[j-1]+1,this.prev[j-1]+substitutionCost);if((i>1)&&(j>1)&&(a[aIdx]===b[bIdx-1])&&(a[aIdx-1]===b[bIdx])){this.current[j]=Math.min(this.current[j],this.prevPrev[j-2]+1)}}const prevPrevTmp=this.prevPrev;this.prevPrev=this.prev;this.prev=this.current;this.current=prevPrevTmp}const distance=this.prev[bLength];return distance<=limit?distance:(limit+1)},};function editDistance(a,b,limit){return editDistanceState.calculate(a,b,limit)}function initSearch(rawSearchIndex){const MAX_RESULTS=200;const NO_TYPE_FILTER=-1;let searchIndex;let functionTypeFingerprint;let currentResults;let typeNameIdMap;const ALIASES=new Map();let typeNameIdOfArray;let typeNameIdOfSlice;let typeNameIdOfArrayOrSlice;let typeNameIdOfTuple;let typeNameIdOfUnit;let typeNameIdOfTupleOrUnit;function buildTypeMapIndex(name,isAssocType){if(name===""||name===null){return null}if(typeNameIdMap.has(name)){const obj=typeNameIdMap.get(name);obj.assocOnly=isAssocType&&obj.assocOnly;return obj.id}else{const id=typeNameIdMap.size;typeNameIdMap.set(name,{id,assocOnly:isAssocType});return id}}function isSpecialStartCharacter(c){return"<\"".indexOf(c)!==-1}function isEndCharacter(c){return"=,>-])".indexOf(c)!==-1}function itemTypeFromName(typename){const index=itemTypes.findIndex(i=>i===typename);if(index<0){throw["Unknown type filter ",typename]}return index}function getStringElem(query,parserState,isInGenerics){if(isInGenerics){throw["Unexpected ","\""," in generics"]}else if(query.literalSearch){throw["Cannot have more than one literal search element"]}else if(parserState.totalElems-parserState.genericsElems>0){throw["Cannot use literal search when there is more than one element"]}parserState.pos+=1;const start=parserState.pos;const end=getIdentEndPosition(parserState);if(parserState.pos>=parserState.length){throw["Unclosed ","\""]}else if(parserState.userQuery[end]!=="\""){throw["Unexpected ",parserState.userQuery[end]," in a string element"]}else if(start===end){throw["Cannot have empty string element"]}parserState.pos+=1;query.literalSearch=true}function isPathStart(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="::"}function isReturnArrow(parserState){return parserState.userQuery.slice(parserState.pos,parserState.pos+2)==="->"}function isIdentCharacter(c){return(c==="_"||(c>="0"&&c<="9")||(c>="a"&&c<="z")||(c>="A"&&c<="Z"))}function isSeparatorCharacter(c){return c===","||c==="="}function isPathSeparator(c){return c===":"||c===" "}function prevIs(parserState,lookingFor){let pos=parserState.pos;while(pos>0){const c=parserState.userQuery[pos-1];if(c===lookingFor){return true}else if(c!==" "){break}pos-=1}return false}function isLastElemGeneric(elems,parserState){return(elems.length>0&&elems[elems.length-1].generics.length>0)||prevIs(parserState,">")}function skipWhitespace(parserState){while(parserState.pos0){throw["Cannot have more than one element if you use quotes"]}const typeFilter=parserState.typeFilter;parserState.typeFilter=null;if(name==="!"){if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive never type ","!"," and ",typeFilter," both specified",]}if(generics.length!==0){throw["Never type ","!"," does not accept generic parameters",]}const bindingName=parserState.isInBinding;parserState.isInBinding=null;return{name:"never",id:null,fullPath:["never"],pathWithoutLast:[],pathLast:"never",normalizedPathLast:"never",generics:[],bindings:new Map(),typeFilter:"primitive",bindingName,}}const quadcolon=/::\s*::/.exec(path);if(path.startsWith("::")){throw["Paths cannot start with ","::"]}else if(path.endsWith("::")){throw["Paths cannot end with ","::"]}else if(quadcolon!==null){throw["Unexpected ",quadcolon[0]]}const pathSegments=path.split(/(?:::\s*)|(?:\s+(?:::\s*)?)/);if(pathSegments.length===0||(pathSegments.length===1&&pathSegments[0]==="")){if(generics.length>0||prevIs(parserState,">")){throw["Found generics without a path"]}else{throw["Unexpected ",parserState.userQuery[parserState.pos]]}}for(const[i,pathSegment]of pathSegments.entries()){if(pathSegment==="!"){if(i!==0){throw["Never type ","!"," is not associated item"]}pathSegments[i]="never"}}parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}const bindingName=parserState.isInBinding;parserState.isInBinding=null;const bindings=new Map();const pathLast=pathSegments[pathSegments.length-1];return{name:name.trim(),id:null,fullPath:pathSegments,pathWithoutLast:pathSegments.slice(0,pathSegments.length-1),pathLast,normalizedPathLast:pathLast.replace(/_/g,""),generics:generics.filter(gen=>{if(gen.bindingName!==null){bindings.set(gen.bindingName.name,[gen,...gen.bindingName.generics]);return false}return true}),bindings,typeFilter,bindingName,}}function getIdentEndPosition(parserState){const start=parserState.pos;let end=parserState.pos;let foundExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}else{throw["Unexpected ",c]}}parserState.pos+=1;end=parserState.pos}if(foundExclamation!==-1&&foundExclamation!==start&&isIdentCharacter(parserState.userQuery[foundExclamation-1])){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=foundExclamation}return end}function getNextElem(query,parserState,elems,isInGenerics){const generics=[];skipWhitespace(parserState);let start=parserState.pos;let end;if("[(".indexOf(parserState.userQuery[parserState.pos])!==-1){let endChar=")";let name="()";let friendlyName="tuple";if(parserState.userQuery[parserState.pos]==="["){endChar="]";name="[]";friendlyName="slice"}parserState.pos+=1;const{foundSeparator}=getItemsBefore(query,parserState,generics,endChar);const typeFilter=parserState.typeFilter;const isInBinding=parserState.isInBinding;if(typeFilter!==null&&typeFilter!=="primitive"){throw["Invalid search type: primitive ",name," and ",typeFilter," both specified",]}parserState.typeFilter=null;parserState.isInBinding=null;for(const gen of generics){if(gen.bindingName!==null){throw["Type parameter ","=",` cannot be within ${friendlyName} `,name]}}if(name==="()"&&!foundSeparator&&generics.length===1&&typeFilter===null){elems.push(generics[0])}else{parserState.totalElems+=1;if(isInGenerics){parserState.genericsElems+=1}elems.push({name:name,id:null,fullPath:[name],pathWithoutLast:[],pathLast:name,normalizedPathLast:name,generics,bindings:new Map(),typeFilter:"primitive",bindingName:isInBinding,})}}else{const isStringElem=parserState.userQuery[start]==="\"";if(isStringElem){start+=1;getStringElem(query,parserState,isInGenerics);end=parserState.pos-1}else{end=getIdentEndPosition(parserState)}if(parserState.pos=end){throw["Found generics without a path"]}parserState.pos+=1;getItemsBefore(query,parserState,generics,">")}if(isStringElem){skipWhitespace(parserState)}if(start>=end&&generics.length===0){return}if(parserState.userQuery[parserState.pos]==="="){if(parserState.isInBinding){throw["Cannot write ","="," twice in a binding"]}if(!isInGenerics){throw["Type parameter ","="," must be within generics list"]}const name=parserState.userQuery.slice(start,end).trim();if(name==="!"){throw["Type parameter ","="," key cannot be ","!"," never type"]}if(name.includes("!")){throw["Type parameter ","="," key cannot be ","!"," macro"]}if(name.includes("::")){throw["Type parameter ","="," key cannot contain ","::"," path"]}if(name.includes(":")){throw["Type parameter ","="," key cannot contain ",":"," type"]}parserState.isInBinding={name,generics}}else{elems.push(createQueryElement(query,parserState,parserState.userQuery.slice(start,end),generics,isInGenerics))}}}function getItemsBefore(query,parserState,elems,endChar){let foundStopChar=true;let foundSeparator=false;let start=parserState.pos;const oldTypeFilter=parserState.typeFilter;parserState.typeFilter=null;const oldIsInBinding=parserState.isInBinding;parserState.isInBinding=null;let extra="";if(endChar===">"){extra="<"}else if(endChar==="]"){extra="["}else if(endChar===")"){extra="("}else if(endChar===""){extra="->"}else{extra=endChar}while(parserState.pos"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(endChar!==""){throw["Expected ",",",", ","=",", or ",endChar,...extra,", found ",c,]}throw["Expected ",","," or ","=",...extra,", found ",c,]}const posBefore=parserState.pos;start=parserState.pos;getNextElem(query,parserState,elems,endChar!=="");if(endChar!==""&&parserState.pos>=parserState.length){throw["Unclosed ",extra]}if(posBefore===parserState.pos){parserState.pos+=1}foundStopChar=false}if(parserState.pos>=parserState.length&&endChar!==""){throw["Unclosed ",extra]}parserState.pos+=1;parserState.typeFilter=oldTypeFilter;parserState.isInBinding=oldIsInBinding;return{foundSeparator}}function checkExtraTypeFilterCharacters(start,parserState){const query=parserState.userQuery.slice(start,parserState.pos).trim();for(const c in query){if(!isIdentCharacter(query[c])){throw["Unexpected ",query[c]," in type filter (before ",":",")",]}}}function parseInput(query,parserState){let foundStopChar=true;let start=parserState.pos;while(parserState.pos"){if(isReturnArrow(parserState)){break}throw["Unexpected ",c," (did you mean ","->","?)"]}else if(parserState.pos>0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]]}throw["Unexpected ",c]}else if(c===":"&&!isPathStart(parserState)){if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}else if(query.elems.length===0){throw["Expected type filter before ",":"]}else if(query.literalSearch){throw["Cannot use quotes on type filter"]}const typeFilterElem=query.elems.pop();checkExtraTypeFilterCharacters(start,parserState);parserState.typeFilter=typeFilterElem.name;parserState.pos+=1;parserState.totalElems-=1;query.literalSearch=false;foundStopChar=true;continue}else if(c===" "){skipWhitespace(parserState);continue}if(!foundStopChar){let extra="";if(isLastElemGeneric(query.elems,parserState)){extra=[" after ",">"]}else if(prevIs(parserState,"\"")){throw["Cannot have more than one element if you use quotes"]}if(parserState.typeFilter!==null){throw["Expected ",","," or ","->",...extra,", found ",c,]}throw["Expected ",",",", ",":"," or ","->",...extra,", found ",c,]}const before=query.elems.length;start=parserState.pos;getNextElem(query,parserState,query.elems,false);if(query.elems.length===before){parserState.pos+=1}foundStopChar=false}if(parserState.typeFilter!==null){throw["Unexpected ",":"," (expected path after type filter ",parserState.typeFilter+":",")",]}while(parserState.pos"]}break}else{parserState.pos+=1}}}function newParsedQuery(userQuery){return{original:userQuery,userQuery:userQuery.toLowerCase(),elems:[],returned:[],foundElems:0,totalElems:0,literalSearch:false,error:null,correction:null,proposeCorrectionFrom:null,proposeCorrectionTo:null,typeFingerprint:new Uint32Array(4),}}function buildUrl(search,filterCrates){let extra="?search="+encodeURIComponent(search);if(filterCrates!==null){extra+="&filter-crate="+encodeURIComponent(filterCrates)}return getNakedUrl()+extra+window.location.hash}function getFilterCrates(){const elem=document.getElementById("crate-search");if(elem&&elem.value!=="all crates"&&rawSearchIndex.has(elem.value)){return elem.value}return null}function parseQuery(userQuery){function convertTypeFilterOnElem(elem){if(elem.typeFilter!==null){let typeFilter=elem.typeFilter;if(typeFilter==="const"){typeFilter="constant"}elem.typeFilter=itemTypeFromName(typeFilter)}else{elem.typeFilter=NO_TYPE_FILTER}for(const elem2 of elem.generics){convertTypeFilterOnElem(elem2)}for(const constraints of elem.bindings.values()){for(const constraint of constraints){convertTypeFilterOnElem(constraint)}}}userQuery=userQuery.trim().replace(/\r|\n|\t/g," ");const parserState={length:userQuery.length,pos:0,totalElems:0,genericsElems:0,typeFilter:null,isInBinding:null,userQuery:userQuery.toLowerCase(),};let query=newParsedQuery(userQuery);try{parseInput(query,parserState);for(const elem of query.elems){convertTypeFilterOnElem(elem)}for(const elem of query.returned){convertTypeFilterOnElem(elem)}}catch(err){query=newParsedQuery(userQuery);query.error=err;return query}if(!query.literalSearch){query.literalSearch=parserState.totalElems>1}query.foundElems=query.elems.length+query.returned.length;query.totalElems=parserState.totalElems;return query}function createQueryResults(results_in_args,results_returned,results_others,parsedQuery){return{"in_args":results_in_args,"returned":results_returned,"others":results_others,"query":parsedQuery,}}function execQuery(parsedQuery,filterCrates,currentCrate){const results_others=new Map(),results_in_args=new Map(),results_returned=new Map();function transformResults(results){const duplicates=new Set();const out=[];for(const result of results){if(result.id!==-1){const obj=searchIndex[result.id];obj.dist=result.dist;const res=buildHrefAndPath(obj);obj.displayPath=pathSplitter(res[0]);obj.fullPath=obj.displayPath+obj.name;obj.fullPath+="|"+obj.ty;if(duplicates.has(obj.fullPath)){continue}duplicates.add(obj.fullPath);obj.href=res[1];out.push(obj);if(out.length>=MAX_RESULTS){break}}}return out}function sortResults(results,isType,preferredCrate){if(results.size===0){return[]}const userQuery=parsedQuery.userQuery;const result_list=[];for(const result of results.values()){result.item=searchIndex[result.id];result.word=searchIndex[result.id].word;result_list.push(result)}result_list.sort((aaa,bbb)=>{let a,b;a=(aaa.word!==userQuery);b=(bbb.word!==userQuery);if(a!==b){return a-b}a=(aaa.index<0);b=(bbb.index<0);if(a!==b){return a-b}a=aaa.path_dist;b=bbb.path_dist;if(a!==b){return a-b}a=aaa.index;b=bbb.index;if(a!==b){return a-b}a=(aaa.dist);b=(bbb.dist);if(a!==b){return a-b}a=aaa.item.deprecated;b=bbb.item.deprecated;if(a!==b){return a-b}a=(aaa.item.crate!==preferredCrate);b=(bbb.item.crate!==preferredCrate);if(a!==b){return a-b}a=aaa.word.length;b=bbb.word.length;if(a!==b){return a-b}a=aaa.word;b=bbb.word;if(a!==b){return(a>b?+1:-1)}a=(aaa.item.desc==="");b=(bbb.item.desc==="");if(a!==b){return a-b}a=aaa.item.ty;b=bbb.item.ty;if(a!==b){return a-b}a=aaa.item.path;b=bbb.item.path;if(a!==b){return(a>b?+1:-1)}return 0});return transformResults(result_list)}function unifyFunctionTypes(fnTypesIn,queryElems,whereClause,mgensIn,solutionCb){const mgens=mgensIn===null?null:new Map(mgensIn);if(queryElems.length===0){return!solutionCb||solutionCb(mgens)}if(!fnTypesIn||fnTypesIn.length===0){return false}const ql=queryElems.length;const fl=fnTypesIn.length;if(ql===1&&queryElems[0].generics.length===0&&queryElems[0].bindings.size===0){const queryElem=queryElems[0];for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){continue}if(fnType.id<0&&queryElem.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==queryElem.id){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,queryElem.id);if(!solutionCb||solutionCb(mgensScratch)){return true}}else if(!solutionCb||solutionCb(mgens?new Map(mgens):null)){return true}}for(const fnType of fnTypesIn){if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){continue}if(fnType.id<0){if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){continue}const mgensScratch=new Map(mgens);mgensScratch.set(fnType.id,0);if(unifyFunctionTypes(whereClause[(-fnType.id)-1],queryElems,whereClause,mgensScratch,solutionCb)){return true}}else if(unifyFunctionTypes([...fnType.generics,...Array.from(fnType.bindings.values()).flat()],queryElems,whereClause,mgens?new Map(mgens):null,solutionCb)){return true}}return false}const fnTypes=fnTypesIn.slice();const flast=fl-1;const qlast=ql-1;const queryElem=queryElems[qlast];let queryElemsTmp=null;for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==queryElem.id){continue}mgensScratch.set(fnType.id,queryElem.id)}else{mgensScratch=mgens}fnTypes[i]=fnTypes[flast];fnTypes.length=flast;if(!queryElemsTmp){queryElemsTmp=queryElems.slice(0,qlast)}const passesUnification=unifyFunctionTypes(fnTypes,queryElemsTmp,whereClause,mgensScratch,mgensScratch=>{if(fnType.generics.length===0&&queryElem.generics.length===0&&fnType.bindings.size===0&&queryElem.bindings.size===0){return!solutionCb||solutionCb(mgensScratch)}const solution=unifyFunctionTypeCheckBindings(fnType,queryElem,whereClause,mgensScratch);if(!solution){return false}const simplifiedGenerics=solution.simplifiedGenerics;for(const simplifiedMgens of solution.mgens){const passesUnification=unifyFunctionTypes(simplifiedGenerics,queryElem.generics,whereClause,simplifiedMgens,solutionCb);if(passesUnification){return true}}return false});if(passesUnification){return true}fnTypes[flast]=fnTypes[i];fnTypes[i]=fnType;fnTypes.length=fl}for(let i=flast;i>=0;i-=1){const fnType=fnTypes[i];if(!unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens)){continue}let mgensScratch;if(fnType.id<0){mgensScratch=new Map(mgens);if(mgensScratch.has(fnType.id)&&mgensScratch.get(fnType.id)!==0){continue}mgensScratch.set(fnType.id,0)}else{mgensScratch=mgens}const generics=fnType.id<0?whereClause[(-fnType.id)-1]:fnType.generics;const bindings=fnType.bindings?Array.from(fnType.bindings.values()).flat():[];const passesUnification=unifyFunctionTypes(fnTypes.toSpliced(i,1,...generics,...bindings),queryElems,whereClause,mgensScratch,solutionCb);if(passesUnification){return true}}return false}function unifyFunctionTypeIsMatchCandidate(fnType,queryElem,whereClause,mgensIn){if(!typePassesFilter(queryElem.typeFilter,fnType.ty)){return false}if(fnType.id<0&&queryElem.id<0){if(mgensIn){if(mgensIn.has(fnType.id)&&mgensIn.get(fnType.id)!==queryElem.id){return false}for(const[fid,qid]of mgensIn.entries()){if(fnType.id!==fid&&queryElem.id===qid){return false}if(fnType.id===fid&&queryElem.id!==qid){return false}}}return true}else{if(queryElem.id===typeNameIdOfArrayOrSlice&&(fnType.id===typeNameIdOfSlice||fnType.id===typeNameIdOfArray)){}else if(queryElem.id===typeNameIdOfTupleOrUnit&&(fnType.id===typeNameIdOfTuple||fnType.id===typeNameIdOfUnit)){}else if(fnType.id!==queryElem.id||queryElem.id===null){return false}if((fnType.generics.length+fnType.bindings.size)===0&&queryElem.generics.length!==0){return false}if(fnType.bindings.size0){const fnTypePath=fnType.path!==undefined&&fnType.path!==null?fnType.path.split("::"):[];if(queryElemPathLength>fnTypePath.length){return false}let i=0;for(const path of fnTypePath){if(path===queryElem.pathWithoutLast[i]){i+=1;if(i>=queryElemPathLength){break}}}if(i0){let mgensSolutionSet=[mgensIn];for(const[name,constraints]of queryElem.bindings.entries()){if(mgensSolutionSet.length===0){return false}if(!fnType.bindings.has(name)){return false}const fnTypeBindings=fnType.bindings.get(name);mgensSolutionSet=mgensSolutionSet.flatMap(mgens=>{const newSolutions=[];unifyFunctionTypes(fnTypeBindings,constraints,whereClause,mgens,newMgens=>{newSolutions.push(newMgens);return false});return newSolutions})}if(mgensSolutionSet.length===0){return false}const binds=Array.from(fnType.bindings.entries()).flatMap(entry=>{const[name,constraints]=entry;if(queryElem.bindings.has(name)){return[]}else{return constraints}});if(simplifiedGenerics.length>0){simplifiedGenerics=[...simplifiedGenerics,...binds]}else{simplifiedGenerics=binds}return{simplifiedGenerics,mgens:mgensSolutionSet}}return{simplifiedGenerics,mgens:[mgensIn]}}function unifyFunctionTypeIsUnboxCandidate(fnType,queryElem,whereClause,mgens){if(fnType.id<0&&queryElem.id>=0){if(!whereClause){return false}if(mgens&&mgens.has(fnType.id)&&mgens.get(fnType.id)!==0){return false}const mgensTmp=new Map(mgens);mgensTmp.set(fnType.id,null);return checkIfInList(whereClause[(-fnType.id)-1],queryElem,whereClause,mgensTmp)}else if(fnType.generics.length>0||fnType.bindings.size>0){const simplifiedGenerics=[...fnType.generics,...Array.from(fnType.bindings.values()).flat(),];return checkIfInList(simplifiedGenerics,queryElem,whereClause,mgens)}return false}function checkIfInList(list,elem,whereClause,mgens){for(const entry of list){if(checkType(entry,elem,whereClause,mgens)){return true}}return false}function checkType(row,elem,whereClause,mgens){if(row.bindings.size===0&&elem.bindings.size===0){if(elem.id<0){return row.id<0||checkIfInList(row.generics,elem,whereClause,mgens)}if(row.id>0&&elem.id>0&&elem.pathWithoutLast.length===0&&typePassesFilter(elem.typeFilter,row.ty)&&elem.generics.length===0&&elem.id!==typeNameIdOfArrayOrSlice&&elem.id!==typeNameIdOfTupleOrUnit){return row.id===elem.id||checkIfInList(row.generics,elem,whereClause,mgens)}}return unifyFunctionTypes([row],[elem],whereClause,mgens)}function checkPath(contains,ty){if(contains.length===0){return 0}const maxPathEditDistance=Math.floor(contains.reduce((acc,next)=>acc+next.length,0)/3);let ret_dist=maxPathEditDistance+1;const path=ty.path.split("::");if(ty.parent&&ty.parent.name){path.push(ty.parent.name.toLowerCase())}const length=path.length;const clength=contains.length;pathiter:for(let i=length-clength;i>=0;i-=1){let dist_total=0;for(let x=0;xmaxPathEditDistance){continue pathiter}dist_total+=dist}}ret_dist=Math.min(ret_dist,Math.round(dist_total/clength))}return ret_dist>maxPathEditDistance?null:ret_dist}function typePassesFilter(filter,type){if(filter<=NO_TYPE_FILTER||filter===type)return true;const name=itemTypes[type];switch(itemTypes[filter]){case"constant":return name==="associatedconstant";case"fn":return name==="method"||name==="tymethod";case"type":return name==="primitive"||name==="associatedtype";case"trait":return name==="traitalias"}return false}function createAliasFromItem(item){return{crate:item.crate,name:item.name,path:item.path,desc:item.desc,ty:item.ty,parent:item.parent,type:item.type,is_alias:true,deprecated:item.deprecated,implDisambiguator:item.implDisambiguator,}}function handleAliases(ret,query,filterCrates,currentCrate){const lowerQuery=query.toLowerCase();const aliases=[];const crateAliases=[];if(filterCrates!==null){if(ALIASES.has(filterCrates)&&ALIASES.get(filterCrates).has(lowerQuery)){const query_aliases=ALIASES.get(filterCrates).get(lowerQuery);for(const alias of query_aliases){aliases.push(createAliasFromItem(searchIndex[alias]))}}}else{for(const[crate,crateAliasesIndex]of ALIASES){if(crateAliasesIndex.has(lowerQuery)){const pushTo=crate===currentCrate?crateAliases:aliases;const query_aliases=crateAliasesIndex.get(lowerQuery);for(const alias of query_aliases){pushTo.push(createAliasFromItem(searchIndex[alias]))}}}}const sortFunc=(aaa,bbb)=>{if(aaa.path{alias.alias=query;const res=buildHrefAndPath(alias);alias.displayPath=pathSplitter(res[0]);alias.fullPath=alias.displayPath+alias.name;alias.href=res[1];ret.others.unshift(alias);if(ret.others.length>MAX_RESULTS){ret.others.pop()}};aliases.forEach(pushFunc);crateAliases.forEach(pushFunc)}function addIntoResults(results,fullId,id,index,dist,path_dist,maxEditDistance){if(dist<=maxEditDistance||index!==-1){if(results.has(fullId)){const result=results.get(fullId);if(result.dontValidate||result.dist<=dist){return}}results.set(fullId,{id:id,index:index,dontValidate:parsedQuery.literalSearch,dist:dist,path_dist:path_dist,})}}function handleSingleArg(row,pos,elem,results_others,results_in_args,results_returned,maxEditDistance){if(!row||(filterCrates!==null&&row.crate!==filterCrates)){return}let path_dist=0;const fullId=row.id;const tfpDist=compareTypeFingerprints(fullId,parsedQuery.typeFingerprint);if(tfpDist!==null){const in_args=row.type&&row.type.inputs&&checkIfInList(row.type.inputs,elem,row.type.where_clause);const returned=row.type&&row.type.output&&checkIfInList(row.type.output,elem,row.type.where_clause);if(in_args){results_in_args.max_dist=Math.max(results_in_args.max_dist||0,tfpDist);const maxDist=results_in_args.sizenormalizedIndex&&normalizedIndex!==-1)){index=normalizedIndex}if(elem.fullPath.length>1){path_dist=checkPath(elem.pathWithoutLast,row);if(path_dist===null){return}}if(parsedQuery.literalSearch){if(row.word===elem.pathLast){addIntoResults(results_others,fullId,pos,index,0,path_dist)}return}const dist=editDistance(row.normalizedName,elem.normalizedPathLast,maxEditDistance);if(index===-1&&dist>maxEditDistance){return}addIntoResults(results_others,fullId,pos,index,dist,path_dist,maxEditDistance)}function handleArgs(row,pos,results){if(!row||(filterCrates!==null&&row.crate!==filterCrates)||!row.type){return}const tfpDist=compareTypeFingerprints(row.id,parsedQuery.typeFingerprint);if(tfpDist===null){return}if(results.size>=MAX_RESULTS&&tfpDist>results.max_dist){return}if(!unifyFunctionTypes(row.type.inputs,parsedQuery.elems,row.type.where_clause,null,mgens=>{return unifyFunctionTypes(row.type.output,parsedQuery.returned,row.type.where_clause,mgens)})){return}results.max_dist=Math.max(results.max_dist||0,tfpDist);addIntoResults(results,row.id,pos,0,tfpDist,0,Number.MAX_VALUE)}function innerRunQuery(){const queryLen=parsedQuery.elems.reduce((acc,next)=>acc+next.pathLast.length,0)+parsedQuery.returned.reduce((acc,next)=>acc+next.pathLast.length,0);const maxEditDistance=Math.floor(queryLen/3);const genericSymbols=new Map();function convertNameToId(elem,isAssocType){if(typeNameIdMap.has(elem.normalizedPathLast)&&(isAssocType||!typeNameIdMap.get(elem.normalizedPathLast).assocOnly)){elem.id=typeNameIdMap.get(elem.normalizedPathLast).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=editDistance(name,elem.normalizedPathLast,maxEditDistance);if(dist<=matchDist&&dist<=maxEditDistance&&(isAssocType||!assocOnly)){if(dist===matchDist&&matchName>name){continue}match=id;matchDist=dist;matchName=name}}if(match!==null){parsedQuery.correction=matchName}elem.id=match}if((elem.id===null&&parsedQuery.totalElems>1&&elem.typeFilter===-1&&elem.generics.length===0&&elem.bindings.size===0)||elem.typeFilter===TY_GENERIC){if(genericSymbols.has(elem.name)){elem.id=genericSymbols.get(elem.name)}else{elem.id=-(genericSymbols.size+1);genericSymbols.set(elem.name,elem.id)}if(elem.typeFilter===-1&&elem.name.length>=3){const maxPartDistance=Math.floor(elem.name.length/3);let matchDist=maxPartDistance+1;let matchName="";for(const name of typeNameIdMap.keys()){const dist=editDistance(name,elem.name,maxPartDistance);if(dist<=matchDist&&dist<=maxPartDistance){if(dist===matchDist&&matchName>name){continue}matchDist=dist;matchName=name}}if(matchName!==""){parsedQuery.proposeCorrectionFrom=elem.name;parsedQuery.proposeCorrectionTo=matchName}}elem.typeFilter=TY_GENERIC}if(elem.generics.length>0&&elem.typeFilter===TY_GENERIC){parsedQuery.error=["Generic type parameter ",elem.name," does not accept generic parameters",]}for(const elem2 of elem.generics){convertNameToId(elem2)}elem.bindings=new Map(Array.from(elem.bindings.entries()).map(entry=>{const[name,constraints]=entry;if(!typeNameIdMap.has(name)){parsedQuery.error=["Type parameter ",name," does not exist",];return[null,[]]}for(const elem2 of constraints){convertNameToId(elem2)}return[typeNameIdMap.get(name).id,constraints]}))}const fps=new Set();for(const elem of parsedQuery.elems){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}for(const elem of parsedQuery.returned){convertNameToId(elem);buildFunctionTypeFingerprint(elem,parsedQuery.typeFingerprint,fps)}if(parsedQuery.foundElems===1&&parsedQuery.returned.length===0){if(parsedQuery.elems.length===1){const elem=parsedQuery.elems[0];for(let i=0,nSearchIndex=searchIndex.length;i0){const sortQ=(a,b)=>{const ag=a.generics.length===0&&a.bindings.size===0;const bg=b.generics.length===0&&b.bindings.size===0;if(ag!==bg){return ag-bg}const ai=a.id>0;const bi=b.id>0;return ai-bi};parsedQuery.elems.sort(sortQ);parsedQuery.returned.sort(sortQ);for(let i=0,nSearchIndex=searchIndex.length;i");if(tmp.endsWith("")){return tmp.slice(0,tmp.length-6)}return tmp}function addTab(array,query,display){const extraClass=display?" active":"";const output=document.createElement("div");if(array.length>0){output.className="search-results "+extraClass;array.forEach(item=>{const name=item.name;const type=itemTypes[item.ty];const longType=longItemTypes[item.ty];const typeName=longType.length!==0?`${longType}`:"?";const link=document.createElement("a");link.className="result-"+type;link.href=item.href;const resultName=document.createElement("div");resultName.className="result-name";resultName.insertAdjacentHTML("beforeend",`${typeName}`);link.appendChild(resultName);let alias=" ";if(item.is_alias){alias=`
\ -${item.alias} - see \ -
`}resultName.insertAdjacentHTML("beforeend",`
${alias}\ -${item.displayPath}${name}\ -
`);const description=document.createElement("div");description.className="desc";description.insertAdjacentHTML("beforeend",item.desc);link.appendChild(description);output.appendChild(link)})}else if(query.error===null){output.className="search-failed"+extraClass;output.innerHTML="No results :(
"+"Try on DuckDuckGo?

"+"Or try looking in one of these:"}return[output,array.length]}function makeTabHeader(tabNb,text,nbElems){const fmtNbElems=nbElems<10?`\u{2007}(${nbElems})\u{2007}\u{2007}`:nbElems<100?`\u{2007}(${nbElems})\u{2007}`:`\u{2007}(${nbElems})`;if(searchState.currentTab===tabNb){return""}return""}function showResults(results,go_to_first,filterCrates){const search=searchState.outputElement();if(go_to_first||(results.others.length===1&&getSettingValue("go-to-only-result")==="true")){window.onunload=()=>{};searchState.removeQueryParameters();const elem=document.createElement("a");elem.href=results.others[0].href;removeClass(elem,"active");document.body.appendChild(elem);elem.click();return}if(results.query===undefined){results.query=parseQuery(searchState.input.value)}currentResults=results.query.userQuery;const ret_others=addTab(results.others,results.query,true);const ret_in_args=addTab(results.in_args,results.query,false);const ret_returned=addTab(results.returned,results.query,false);let currentTab=searchState.currentTab;if((currentTab===0&&ret_others[1]===0)||(currentTab===1&&ret_in_args[1]===0)||(currentTab===2&&ret_returned[1]===0)){if(ret_others[1]!==0){currentTab=0}else if(ret_in_args[1]!==0){currentTab=1}else if(ret_returned[1]!==0){currentTab=2}}let crates="";if(rawSearchIndex.size>1){crates=" in 
"}let output=`

Results${crates}

`;if(results.query.error!==null){const error=results.query.error;error.forEach((value,index)=>{value=value.split("<").join("<").split(">").join(">");if(index%2!==0){error[index]=`${value.replaceAll(" ", " ")}`}else{error[index]=value}});output+=`

Query parser error: "${error.join("")}".

`;output+="
"+makeTabHeader(0,"In Names",ret_others[1])+"
";currentTab=0}else if(results.query.foundElems<=1&&results.query.returned.length===0){output+="
"+makeTabHeader(0,"In Names",ret_others[1])+makeTabHeader(1,"In Parameters",ret_in_args[1])+makeTabHeader(2,"In Return Types",ret_returned[1])+"
"}else{const signatureTabTitle=results.query.elems.length===0?"In Function Return Types":results.query.returned.length===0?"In Function Parameters":"In Function Signatures";output+="
"+makeTabHeader(0,signatureTabTitle,ret_others[1])+"
";currentTab=0}if(results.query.correction!==null){const orig=results.query.returned.length>0?results.query.returned[0].name:results.query.elems[0].name;output+="

"+`Type "${orig}" not found. `+"Showing results for closest type name "+`"${results.query.correction}" instead.

`}if(results.query.proposeCorrectionFrom!==null){const orig=results.query.proposeCorrectionFrom;const targ=results.query.proposeCorrectionTo;output+="

"+`Type "${orig}" not found and used as generic parameter. `+`Consider searching for "${targ}" instead.

`}const resultsElem=document.createElement("div");resultsElem.id="results";resultsElem.appendChild(ret_others[0]);resultsElem.appendChild(ret_in_args[0]);resultsElem.appendChild(ret_returned[0]);search.innerHTML=output;const crateSearch=document.getElementById("crate-search");if(crateSearch){crateSearch.addEventListener("input",updateCrate)}search.appendChild(resultsElem);searchState.showResults(search);const elems=document.getElementById("search-tabs").childNodes;searchState.focusedByTab=[];let i=0;for(const elem of elems){const j=i;elem.onclick=()=>printTab(j);searchState.focusedByTab.push(null);i+=1}printTab(currentTab)}function updateSearchHistory(url){if(!browserSupportsHistoryApi()){return}const params=searchState.getQueryStringParams();if(!history.state&&!params.search){history.pushState(null,"",url)}else{history.replaceState(null,"",url)}}function search(forced){const query=parseQuery(searchState.input.value.trim());let filterCrates=getFilterCrates();if(!forced&&query.userQuery===currentResults){if(query.userQuery.length>0){putBackSearch()}return}searchState.setLoadingSearch();const params=searchState.getQueryStringParams();if(filterCrates===null&¶ms["filter-crate"]!==undefined){filterCrates=params["filter-crate"]}searchState.title="Results for "+query.original+" - Rust";updateSearchHistory(buildUrl(query.original,filterCrates));showResults(execQuery(query,filterCrates,window.currentCrate),params.go_to_first,filterCrates)}function buildItemSearchTypeAll(types,lowercasePaths){return types.length>0?types.map(type=>buildItemSearchType(type,lowercasePaths)):EMPTY_GENERICS_ARRAY}const EMPTY_BINDINGS_MAP=new Map();const EMPTY_GENERICS_ARRAY=[];let TYPES_POOL=new Map();function buildItemSearchType(type,lowercasePaths,isAssocType){const PATH_INDEX_DATA=0;const GENERICS_DATA=1;const BINDINGS_DATA=2;let pathIndex,generics,bindings;if(typeof type==="number"){pathIndex=type;generics=EMPTY_GENERICS_ARRAY;bindings=EMPTY_BINDINGS_MAP}else{pathIndex=type[PATH_INDEX_DATA];generics=buildItemSearchTypeAll(type[GENERICS_DATA],lowercasePaths);if(type.length>BINDINGS_DATA&&type[BINDINGS_DATA].length>0){bindings=new Map(type[BINDINGS_DATA].map(binding=>{const[assocType,constraints]=binding;return[buildItemSearchType(assocType,lowercasePaths,true).id,buildItemSearchTypeAll(constraints,lowercasePaths),]}))}else{bindings=EMPTY_BINDINGS_MAP}}let result;if(pathIndex<0){result={id:pathIndex,ty:TY_GENERIC,path:null,generics,bindings,}}else if(pathIndex===0){result={id:null,ty:null,path:null,generics,bindings,}}else{const item=lowercasePaths[pathIndex-1];result={id:buildTypeMapIndex(item.name,isAssocType),ty:item.ty,path:item.path,generics,bindings,}}const cr=TYPES_POOL.get(result.id);if(cr){if(cr.generics.length===result.generics.length&&cr.generics!==result.generics&&cr.generics.every((x,i)=>result.generics[i]===x)){result.generics=cr.generics}if(cr.bindings.size===result.bindings.size&&cr.bindings!==result.bindings){let ok=true;for(const[k,v]of cr.bindings.entries()){const v2=result.bindings.get(v);if(!v2){ok=false;break}if(v!==v2&&v.length===v2.length&&v.every((x,i)=>v2[i]===x)){result.bindings.set(k,v)}else if(v!==v2){ok=false;break}}if(ok){result.bindings=cr.bindings}}if(cr.ty===result.ty&&cr.path===result.path&&cr.bindings===result.bindings&&cr.generics===result.generics&&cr.ty===result.ty){return cr}}TYPES_POOL.set(result.id,result);return result}function buildFunctionSearchType(itemFunctionDecoder,lowercasePaths){const c=itemFunctionDecoder.string.charCodeAt(itemFunctionDecoder.offset);itemFunctionDecoder.offset+=1;const[zero,ua,la,ob,cb]=["0","@","`","{","}"].map(c=>c.charCodeAt(0));if(c===la){return null}if(c>=zero&&c>1];itemFunctionDecoder.offset+=1;return sign?-value:value}const functionSearchType=decodeList();const INPUTS_DATA=0;const OUTPUT_DATA=1;let inputs,output;if(typeof functionSearchType[INPUTS_DATA]==="number"){inputs=[buildItemSearchType(functionSearchType[INPUTS_DATA],lowercasePaths)]}else{inputs=buildItemSearchTypeAll(functionSearchType[INPUTS_DATA],lowercasePaths)}if(functionSearchType.length>1){if(typeof functionSearchType[OUTPUT_DATA]==="number"){output=[buildItemSearchType(functionSearchType[OUTPUT_DATA],lowercasePaths)]}else{output=buildItemSearchTypeAll(functionSearchType[OUTPUT_DATA],lowercasePaths)}}else{output=[]}const where_clause=[];const l=functionSearchType.length;for(let i=2;i16){itemFunctionDecoder.backrefQueue.pop()}return ret}function buildFunctionTypeFingerprint(type,output,fps){let input=type.id;if(input===typeNameIdOfArray||input===typeNameIdOfSlice){input=typeNameIdOfArrayOrSlice}if(input===typeNameIdOfTuple||input===typeNameIdOfUnit){input=typeNameIdOfTupleOrUnit}const hashint1=k=>{k=(~~k+0x7ed55d16)+(k<<12);k=(k ^ 0xc761c23c)^(k>>>19);k=(~~k+0x165667b1)+(k<<5);k=(~~k+0xd3a2646c)^(k<<9);k=(~~k+0xfd7046c5)+(k<<3);return(k ^ 0xb55a4f09)^(k>>>16)};const hashint2=k=>{k=~k+(k<<15);k ^=k>>>12;k+=k<<2;k ^=k>>>4;k=Math.imul(k,2057);return k ^(k>>16)};if(input!==null){const h0a=hashint1(input);const h0b=hashint2(input);const h1a=~~(h0a+Math.imul(h0b,2));const h1b=~~(h0a+Math.imul(h0b,3));const h2a=~~(h0a+Math.imul(h0b,4));const h2b=~~(h0a+Math.imul(h0b,5));output[0]|=(1<<(h0a%32))|(1<<(h1b%32));output[1]|=(1<<(h1a%32))|(1<<(h2b%32));output[2]|=(1<<(h2a%32))|(1<<(h0b%32));fps.add(input)}for(const g of type.generics){buildFunctionTypeFingerprint(g,output,fps)}const fb={id:null,ty:0,generics:EMPTY_GENERICS_ARRAY,bindings:EMPTY_BINDINGS_MAP,};for(const[k,v]of type.bindings.entries()){fb.id=k;fb.generics=v;buildFunctionTypeFingerprint(fb,output,fps)}output[3]=fps.size}function compareTypeFingerprints(fullId,queryFingerprint){const fh0=functionTypeFingerprint[fullId*4];const fh1=functionTypeFingerprint[(fullId*4)+1];const fh2=functionTypeFingerprint[(fullId*4)+2];const[qh0,qh1,qh2]=queryFingerprint;const[in0,in1,in2]=[fh0&qh0,fh1&qh1,fh2&qh2];if((in0 ^ qh0)||(in1 ^ qh1)||(in2 ^ qh2)){return null}return functionTypeFingerprint[(fullId*4)+3]}function buildIndex(rawSearchIndex){searchIndex=[];typeNameIdMap=new Map();const charA="A".charCodeAt(0);let currentIndex=0;let id=0;typeNameIdOfArray=buildTypeMapIndex("array");typeNameIdOfSlice=buildTypeMapIndex("slice");typeNameIdOfTuple=buildTypeMapIndex("tuple");typeNameIdOfUnit=buildTypeMapIndex("unit");typeNameIdOfArrayOrSlice=buildTypeMapIndex("[]");typeNameIdOfTupleOrUnit=buildTypeMapIndex("()");for(const crate of rawSearchIndex.values()){id+=crate.t.length+1}functionTypeFingerprint=new Uint32Array((id+1)*4);id=0;for(const[crate,crateCorpus]of rawSearchIndex){const crateRow={crate:crate,ty:3,name:crate,path:"",desc:crateCorpus.doc,parent:undefined,type:null,id:id,word:crate,normalizedName:crate.indexOf("_")===-1?crate:crate.replace(/_/g,""),deprecated:null,implDisambiguator:null,};id+=1;searchIndex.push(crateRow);currentIndex+=1;const itemTypes=crateCorpus.t;const itemNames=crateCorpus.n;const itemPaths=new Map(crateCorpus.q);const itemDescs=crateCorpus.d;const itemParentIdxs=crateCorpus.i;const itemFunctionDecoder={string:crateCorpus.f,offset:0,backrefQueue:[],};const deprecatedItems=new Set(crateCorpus.c);const implDisambiguator=new Map(crateCorpus.b);const paths=crateCorpus.p;const aliases=crateCorpus.a;const lowercasePaths=[];let len=paths.length;let lastPath=itemPaths.get(0);for(let i=0;i2){path=itemPaths.has(elem[2])?itemPaths.get(elem[2]):lastPath;lastPath=path}lowercasePaths.push({ty:ty,name:name.toLowerCase(),path:path});paths[i]={ty:ty,name:name,path:path}}lastPath="";len=itemTypes.length;for(let i=0;i0?paths[itemParentIdxs[i]-1]:undefined,type,id:id,word,normalizedName:word.indexOf("_")===-1?word:word.replace(/_/g,""),deprecated:deprecatedItems.has(i),implDisambiguator:implDisambiguator.has(i)?implDisambiguator.get(i):null,};id+=1;searchIndex.push(row);lastPath=row.path}if(aliases){const currentCrateAliases=new Map();ALIASES.set(crate,currentCrateAliases);for(const alias_name in aliases){if(!Object.prototype.hasOwnProperty.call(aliases,alias_name)){continue}let currentNameAliases;if(currentCrateAliases.has(alias_name)){currentNameAliases=currentCrateAliases.get(alias_name)}else{currentNameAliases=[];currentCrateAliases.set(alias_name,currentNameAliases)}for(const local_alias of aliases[alias_name]){currentNameAliases.push(local_alias+currentIndex)}}}currentIndex+=itemTypes.length}TYPES_POOL=new Map()}function onSearchSubmit(e){e.preventDefault();searchState.clearInputTimeout();search()}function putBackSearch(){const search_input=searchState.input;if(!searchState.input){return}if(search_input.value!==""&&!searchState.isDisplayed()){searchState.showResults();if(browserSupportsHistoryApi()){history.replaceState(null,"",buildUrl(search_input.value,getFilterCrates()))}document.title=searchState.title}}function registerSearchEvents(){const params=searchState.getQueryStringParams();if(searchState.input.value===""){searchState.input.value=params.search||""}const searchAfter500ms=()=>{searchState.clearInputTimeout();if(searchState.input.value.length===0){searchState.hideResults()}else{searchState.timeout=setTimeout(search,500)}};searchState.input.onkeyup=searchAfter500ms;searchState.input.oninput=searchAfter500ms;document.getElementsByClassName("search-form")[0].onsubmit=onSearchSubmit;searchState.input.onchange=e=>{if(e.target!==document.activeElement){return}searchState.clearInputTimeout();setTimeout(search,0)};searchState.input.onpaste=searchState.input.onchange;searchState.outputElement().addEventListener("keydown",e=>{if(e.altKey||e.ctrlKey||e.shiftKey||e.metaKey){return}if(e.which===38){const previous=document.activeElement.previousElementSibling;if(previous){previous.focus()}else{searchState.focus()}e.preventDefault()}else if(e.which===40){const next=document.activeElement.nextElementSibling;if(next){next.focus()}const rect=document.activeElement.getBoundingClientRect();if(window.innerHeight-rect.bottom{if(e.which===40){focusSearchResult();e.preventDefault()}});searchState.input.addEventListener("focus",()=>{putBackSearch()});searchState.input.addEventListener("blur",()=>{searchState.input.placeholder=searchState.input.origPlaceholder});if(browserSupportsHistoryApi()){const previousTitle=document.title;window.addEventListener("popstate",e=>{const params=searchState.getQueryStringParams();document.title=previousTitle;currentResults=null;if(params.search&¶ms.search.length>0){searchState.input.value=params.search;e.preventDefault();search()}else{searchState.input.value="";searchState.hideResults()}})}window.onpageshow=()=>{const qSearch=searchState.getQueryStringParams().search;if(searchState.input.value===""&&qSearch){searchState.input.value=qSearch}search()}}function updateCrate(ev){if(ev.target.value==="all crates"){const query=searchState.input.value.trim();updateSearchHistory(buildUrl(query,null))}currentResults=null;search(true)}buildIndex(rawSearchIndex);if(typeof window!=="undefined"){registerSearchEvents();if(window.searchState.getQueryStringParams().search){search()}}if(typeof exports!=="undefined"){exports.initSearch=initSearch;exports.execQuery=execQuery;exports.parseQuery=parseQuery}}if(typeof window!=="undefined"){window.initSearch=initSearch;if(window.searchIndex!==undefined){initSearch(window.searchIndex)}}else{initSearch(new Map())}})() \ No newline at end of file diff --git a/ch5/static.files/storage-e32f0c247825364d.js b/ch5/static.files/storage-e32f0c247825364d.js new file mode 100644 index 00000000..61ddce23 --- /dev/null +++ b/ch5/static.files/storage-e32f0c247825364d.js @@ -0,0 +1 @@ +"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){const themeNames=getVar("themes").split(",").filter(t=>t);themeNames.push(...builtinThemes);if(themeNames.indexOf(newThemeName)===-1){return}if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+encodeURIComponent(newThemeName)+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px",)}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px",)}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}}) \ No newline at end of file diff --git a/ch5/static.files/storage-f2adc0d6ca4d09fb.js b/ch5/static.files/storage-f2adc0d6ca4d09fb.js deleted file mode 100644 index 17233608..00000000 --- a/ch5/static.files/storage-f2adc0d6ca4d09fb.js +++ /dev/null @@ -1 +0,0 @@ -"use strict";const builtinThemes=["light","dark","ayu"];const darkThemes=["dark","ayu"];window.currentTheme=document.getElementById("themeStyle");const settingsDataset=(function(){const settingsElement=document.getElementById("default-settings");return settingsElement&&settingsElement.dataset?settingsElement.dataset:null})();function getSettingValue(settingName){const current=getCurrentValue(settingName);if(current===null&&settingsDataset!==null){const def=settingsDataset[settingName.replace(/-/g,"_")];if(def!==undefined){return def}}return current}const localStoredTheme=getSettingValue("theme");function hasClass(elem,className){return elem&&elem.classList&&elem.classList.contains(className)}function addClass(elem,className){if(elem&&elem.classList){elem.classList.add(className)}}function removeClass(elem,className){if(elem&&elem.classList){elem.classList.remove(className)}}function onEach(arr,func){for(const elem of arr){if(func(elem)){return true}}return false}function onEachLazy(lazyArray,func){return onEach(Array.prototype.slice.call(lazyArray),func)}function updateLocalStorage(name,value){try{window.localStorage.setItem("rustdoc-"+name,value)}catch(e){}}function getCurrentValue(name){try{return window.localStorage.getItem("rustdoc-"+name)}catch(e){return null}}const getVar=(function getVar(name){const el=document.querySelector("head > meta[name='rustdoc-vars']");return el?el.attributes["data-"+name].value:null});function switchTheme(newThemeName,saveTheme){if(saveTheme){updateLocalStorage("theme",newThemeName)}document.documentElement.setAttribute("data-theme",newThemeName);if(builtinThemes.indexOf(newThemeName)!==-1){if(window.currentTheme){window.currentTheme.parentNode.removeChild(window.currentTheme);window.currentTheme=null}}else{const newHref=getVar("root-path")+newThemeName+getVar("resource-suffix")+".css";if(!window.currentTheme){if(document.readyState==="loading"){document.write(``);window.currentTheme=document.getElementById("themeStyle")}else{window.currentTheme=document.createElement("link");window.currentTheme.rel="stylesheet";window.currentTheme.id="themeStyle";window.currentTheme.href=newHref;document.documentElement.appendChild(window.currentTheme)}}else if(newHref!==window.currentTheme.href){window.currentTheme.href=newHref}}}const updateTheme=(function(){const mql=window.matchMedia("(prefers-color-scheme: dark)");function updateTheme(){if(getSettingValue("use-system-theme")!=="false"){const lightTheme=getSettingValue("preferred-light-theme")||"light";const darkTheme=getSettingValue("preferred-dark-theme")||"dark";updateLocalStorage("use-system-theme","true");switchTheme(mql.matches?darkTheme:lightTheme,true)}else{switchTheme(getSettingValue("theme"),false)}}mql.addEventListener("change",updateTheme);return updateTheme})();if(getSettingValue("use-system-theme")!=="false"&&window.matchMedia){if(getSettingValue("use-system-theme")===null&&getSettingValue("preferred-dark-theme")===null&&darkThemes.indexOf(localStoredTheme)>=0){updateLocalStorage("preferred-dark-theme",localStoredTheme)}}updateTheme();if(getSettingValue("source-sidebar-show")==="true"){addClass(document.documentElement,"src-sidebar-expanded")}if(getSettingValue("hide-sidebar")==="true"){addClass(document.documentElement,"hide-sidebar")}function updateSidebarWidth(){const desktopSidebarWidth=getSettingValue("desktop-sidebar-width");if(desktopSidebarWidth&&desktopSidebarWidth!=="null"){document.documentElement.style.setProperty("--desktop-sidebar-width",desktopSidebarWidth+"px")}const srcSidebarWidth=getSettingValue("src-sidebar-width");if(srcSidebarWidth&&srcSidebarWidth!=="null"){document.documentElement.style.setProperty("--src-sidebar-width",srcSidebarWidth+"px")}}updateSidebarWidth();window.addEventListener("pageshow",ev=>{if(ev.persisted){setTimeout(updateTheme,0);setTimeout(updateSidebarWidth,0)}}) \ No newline at end of file diff --git a/ch5/static.files/wheel-7b819b6101059cd0.svg b/ch5/static.files/wheel-7b819b6101059cd0.svg deleted file mode 100644 index 83c07f63..00000000 --- a/ch5/static.files/wheel-7b819b6101059cd0.svg +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/ch5/trait.impl/core/clone/trait.Clone.js b/ch5/trait.impl/core/clone/trait.Clone.js index a08cf9e2..f607ded8 100644 --- a/ch5/trait.impl/core/clone/trait.Clone.js +++ b/ch5/trait.impl/core/clone/trait.Clone.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Clone for VirtAddr"],["impl Clone for PageTableEntry"],["impl Clone for MapPermission"],["impl<T> Clone for SimpleRange<T>"],["impl Clone for PTEFlags"],["impl Clone for TaskStatus"],["impl Clone for PhysAddr"],["impl Clone for PhysPageNum"],["impl Clone for VirtPageNum"],["impl Clone for MapType"]] +"os":[["impl Clone for MapType"],["impl Clone for TaskStatus"],["impl Clone for PhysAddr"],["impl Clone for PhysPageNum"],["impl Clone for VirtAddr"],["impl Clone for VirtPageNum"],["impl Clone for MapPermission"],["impl Clone for PTEFlags"],["impl Clone for PageTableEntry"],["impl<T> Clone for SimpleRange<T>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/cmp/trait.Eq.js b/ch5/trait.impl/core/cmp/trait.Eq.js index d27d7a49..54648b68 100644 --- a/ch5/trait.impl/core/cmp/trait.Eq.js +++ b/ch5/trait.impl/core/cmp/trait.Eq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Eq for PhysPageNum"],["impl Eq for PTEFlags"],["impl Eq for MapPermission"],["impl Eq for PhysAddr"],["impl Eq for VirtPageNum"],["impl Eq for VirtAddr"]] +"os":[["impl Eq for PhysAddr"],["impl Eq for PhysPageNum"],["impl Eq for VirtAddr"],["impl Eq for VirtPageNum"],["impl Eq for MapPermission"],["impl Eq for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/cmp/trait.Ord.js b/ch5/trait.impl/core/cmp/trait.Ord.js index 55c97ffc..303861e9 100644 --- a/ch5/trait.impl/core/cmp/trait.Ord.js +++ b/ch5/trait.impl/core/cmp/trait.Ord.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Ord for PhysPageNum"],["impl Ord for VirtPageNum"],["impl Ord for PTEFlags"],["impl Ord for PhysAddr"],["impl Ord for MapPermission"],["impl Ord for VirtAddr"]] +"os":[["impl Ord for PhysAddr"],["impl Ord for PhysPageNum"],["impl Ord for VirtAddr"],["impl Ord for VirtPageNum"],["impl Ord for MapPermission"],["impl Ord for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/cmp/trait.PartialEq.js b/ch5/trait.impl/core/cmp/trait.PartialEq.js index 2fdeb7bd..b56ddb12 100644 --- a/ch5/trait.impl/core/cmp/trait.PartialEq.js +++ b/ch5/trait.impl/core/cmp/trait.PartialEq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl PartialEq for VirtPageNum"],["impl PartialEq for MapType"],["impl PartialEq for TaskStatus"],["impl PartialEq for VirtAddr"],["impl PartialEq for PhysAddr"],["impl PartialEq for PhysPageNum"],["impl PartialEq for PTEFlags"],["impl PartialEq for MapPermission"]] +"os":[["impl PartialEq for MapType"],["impl PartialEq for TaskStatus"],["impl PartialEq for PhysAddr"],["impl PartialEq for PhysPageNum"],["impl PartialEq for VirtAddr"],["impl PartialEq for VirtPageNum"],["impl PartialEq for MapPermission"],["impl PartialEq for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/cmp/trait.PartialOrd.js b/ch5/trait.impl/core/cmp/trait.PartialOrd.js index 90811718..a51d4ced 100644 --- a/ch5/trait.impl/core/cmp/trait.PartialOrd.js +++ b/ch5/trait.impl/core/cmp/trait.PartialOrd.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl PartialOrd for PhysAddr"],["impl PartialOrd for MapPermission"],["impl PartialOrd for VirtAddr"],["impl PartialOrd for VirtPageNum"],["impl PartialOrd for PTEFlags"],["impl PartialOrd for PhysPageNum"]] +"os":[["impl PartialOrd for PhysAddr"],["impl PartialOrd for PhysPageNum"],["impl PartialOrd for VirtAddr"],["impl PartialOrd for VirtPageNum"],["impl PartialOrd for MapPermission"],["impl PartialOrd for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/convert/trait.From.js b/ch5/trait.impl/core/convert/trait.From.js index 2e6e85c8..0cdeb45d 100644 --- a/ch5/trait.impl/core/convert/trait.From.js +++ b/ch5/trait.impl/core/convert/trait.From.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl From<PhysPageNum> for usize"],["impl From<PhysPageNum> for PhysAddr"],["impl From<VirtAddr> for VirtPageNum"],["impl From<usize> for PhysPageNum"],["impl From<usize> for VirtAddr"],["impl From<VirtPageNum> for VirtAddr"],["impl From<PhysAddr> for PhysPageNum"],["impl From<VirtPageNum> for usize"],["impl From<PhysAddr> for usize"],["impl From<usize> for PhysAddr"],["impl From<VirtAddr> for usize"],["impl From<usize> for VirtPageNum"]] +"os":[["impl From<usize> for PhysAddr"],["impl From<usize> for PhysPageNum"],["impl From<usize> for VirtAddr"],["impl From<usize> for VirtPageNum"],["impl From<PhysAddr> for usize"],["impl From<PhysAddr> for PhysPageNum"],["impl From<PhysPageNum> for usize"],["impl From<PhysPageNum> for PhysAddr"],["impl From<VirtAddr> for usize"],["impl From<VirtAddr> for VirtPageNum"],["impl From<VirtPageNum> for usize"],["impl From<VirtPageNum> for VirtAddr"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/fmt/trait.Debug.js b/ch5/trait.impl/core/fmt/trait.Debug.js index 909db203..c4670413 100644 --- a/ch5/trait.impl/core/fmt/trait.Debug.js +++ b/ch5/trait.impl/core/fmt/trait.Debug.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Debug for FrameTracker"],["impl Debug for VirtAddr"],["impl Debug for PTEFlags"],["impl Debug for PhysAddr"],["impl Debug for MapType"],["impl Debug for PhysPageNum"],["impl Debug for VirtPageNum"],["impl Debug for MapPermission"]] +"os":[["impl Debug for MapType"],["impl Debug for PhysAddr"],["impl Debug for PhysPageNum"],["impl Debug for VirtAddr"],["impl Debug for VirtPageNum"],["impl Debug for FrameTracker"],["impl Debug for MapPermission"],["impl Debug for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/fmt/trait.Octal.js b/ch5/trait.impl/core/fmt/trait.Octal.js index 3afa0c76..ddba3707 100644 --- a/ch5/trait.impl/core/fmt/trait.Octal.js +++ b/ch5/trait.impl/core/fmt/trait.Octal.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Octal for PTEFlags"],["impl Octal for MapPermission"]] +"os":[["impl Octal for MapPermission"],["impl Octal for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/iter/traits/collect/trait.Extend.js b/ch5/trait.impl/core/iter/traits/collect/trait.Extend.js index 2e9493cb..51c544a2 100644 --- a/ch5/trait.impl/core/iter/traits/collect/trait.Extend.js +++ b/ch5/trait.impl/core/iter/traits/collect/trait.Extend.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Extend<PTEFlags> for PTEFlags"],["impl Extend<MapPermission> for MapPermission"]] +"os":[["impl Extend<MapPermission> for MapPermission"],["impl Extend<PTEFlags> for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.Copy.js b/ch5/trait.impl/core/marker/trait.Copy.js index 5ecac5cc..9acc8ebf 100644 --- a/ch5/trait.impl/core/marker/trait.Copy.js +++ b/ch5/trait.impl/core/marker/trait.Copy.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Copy for VirtAddr"],["impl<T> Copy for SimpleRange<T>"],["impl Copy for MapPermission"],["impl Copy for PhysAddr"],["impl Copy for MapType"],["impl Copy for PhysPageNum"],["impl Copy for VirtPageNum"],["impl Copy for TaskStatus"],["impl Copy for PageTableEntry"],["impl Copy for PTEFlags"]] +"os":[["impl Copy for MapType"],["impl Copy for TaskStatus"],["impl Copy for PhysAddr"],["impl Copy for PhysPageNum"],["impl Copy for VirtAddr"],["impl Copy for VirtPageNum"],["impl Copy for MapPermission"],["impl Copy for PTEFlags"],["impl Copy for PageTableEntry"],["impl<T> Copy for SimpleRange<T>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.Freeze.js b/ch5/trait.impl/core/marker/trait.Freeze.js index 621256b2..5b19db15 100644 --- a/ch5/trait.impl/core/marker/trait.Freeze.js +++ b/ch5/trait.impl/core/marker/trait.Freeze.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Freeze for Stdout",1,["os::console::Stdout"]],["impl Freeze for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Freeze for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Freeze for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Freeze for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Freeze for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl<T> Freeze for SimpleRange<T>
where\n T: Freeze,
",1,["os::mm::address::SimpleRange"]],["impl<T> Freeze for SimpleRangeIterator<T>
where\n T: Freeze,
",1,["os::mm::address::SimpleRangeIterator"]],["impl Freeze for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Freeze for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Freeze for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Freeze for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Freeze for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Freeze for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Freeze for MapType",1,["os::mm::memory_set::MapType"]],["impl Freeze for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Freeze for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Freeze for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Freeze for PageTable",1,["os::mm::page_table::PageTable"]],["impl<T> !Freeze for UPSafeCell<T>",1,["os::sync::up::UPSafeCell"]],["impl Freeze for TaskContext",1,["os::task::context::TaskContext"]],["impl Freeze for TaskManager",1,["os::task::manager::TaskManager"]],["impl Freeze for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Freeze for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Freeze for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Freeze for PidHandle",1,["os::task::pid::PidHandle"]],["impl Freeze for KernelStack",1,["os::task::pid::KernelStack"]],["impl Freeze for Processor",1,["os::task::processor::Processor"]],["impl Freeze for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl !Freeze for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Freeze for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Freeze for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Freeze for INITPROC",1,["os::task::INITPROC"]],["impl Freeze for TrapContext",1,["os::trap::context::TrapContext"]]] +"os":[["impl !Freeze for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Freeze for MapType",1,["os::mm::memory_set::MapType"]],["impl Freeze for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Freeze for Stdout",1,["os::console::Stdout"]],["impl Freeze for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Freeze for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Freeze for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Freeze for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Freeze for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl Freeze for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Freeze for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Freeze for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Freeze for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Freeze for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Freeze for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Freeze for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Freeze for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Freeze for PageTable",1,["os::mm::page_table::PageTable"]],["impl Freeze for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Freeze for TaskContext",1,["os::task::context::TaskContext"]],["impl Freeze for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Freeze for TaskManager",1,["os::task::manager::TaskManager"]],["impl Freeze for KernelStack",1,["os::task::pid::KernelStack"]],["impl Freeze for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Freeze for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Freeze for PidHandle",1,["os::task::pid::PidHandle"]],["impl Freeze for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Freeze for Processor",1,["os::task::processor::Processor"]],["impl Freeze for INITPROC",1,["os::task::INITPROC"]],["impl Freeze for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Freeze for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> !Freeze for UPSafeCell<T>",1,["os::sync::up::UPSafeCell"]],["impl<T> Freeze for SimpleRange<T>
where\n T: Freeze,
",1,["os::mm::address::SimpleRange"]],["impl<T> Freeze for SimpleRangeIterator<T>
where\n T: Freeze,
",1,["os::mm::address::SimpleRangeIterator"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.Send.js b/ch5/trait.impl/core/marker/trait.Send.js index a81ada81..0523d396 100644 --- a/ch5/trait.impl/core/marker/trait.Send.js +++ b/ch5/trait.impl/core/marker/trait.Send.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Send for Stdout",1,["os::console::Stdout"]],["impl Send for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Send for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Send for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Send for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Send for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl<T> Send for SimpleRange<T>
where\n T: Send,
",1,["os::mm::address::SimpleRange"]],["impl<T> Send for SimpleRangeIterator<T>
where\n T: Send,
",1,["os::mm::address::SimpleRangeIterator"]],["impl Send for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Send for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Send for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Send for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Send for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Send for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Send for MapType",1,["os::mm::memory_set::MapType"]],["impl Send for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Send for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Send for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Send for PageTable",1,["os::mm::page_table::PageTable"]],["impl<T> Send for UPSafeCell<T>
where\n T: Send,
",1,["os::sync::up::UPSafeCell"]],["impl Send for TaskContext",1,["os::task::context::TaskContext"]],["impl Send for TaskManager",1,["os::task::manager::TaskManager"]],["impl Send for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Send for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Send for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Send for PidHandle",1,["os::task::pid::PidHandle"]],["impl Send for KernelStack",1,["os::task::pid::KernelStack"]],["impl Send for Processor",1,["os::task::processor::Processor"]],["impl Send for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Send for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Send for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Send for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Send for INITPROC",1,["os::task::INITPROC"]],["impl Send for TrapContext",1,["os::trap::context::TrapContext"]]] +"os":[["impl Send for MapType",1,["os::mm::memory_set::MapType"]],["impl Send for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Send for Stdout",1,["os::console::Stdout"]],["impl Send for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Send for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Send for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Send for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Send for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl Send for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Send for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Send for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Send for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Send for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Send for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Send for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Send for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Send for PageTable",1,["os::mm::page_table::PageTable"]],["impl Send for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Send for TaskContext",1,["os::task::context::TaskContext"]],["impl Send for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Send for TaskManager",1,["os::task::manager::TaskManager"]],["impl Send for KernelStack",1,["os::task::pid::KernelStack"]],["impl Send for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Send for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Send for PidHandle",1,["os::task::pid::PidHandle"]],["impl Send for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Send for Processor",1,["os::task::processor::Processor"]],["impl Send for INITPROC",1,["os::task::INITPROC"]],["impl Send for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Send for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Send for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> Send for SimpleRange<T>
where\n T: Send,
",1,["os::mm::address::SimpleRange"]],["impl<T> Send for SimpleRangeIterator<T>
where\n T: Send,
",1,["os::mm::address::SimpleRangeIterator"]],["impl<T> Send for UPSafeCell<T>
where\n T: Send,
",1,["os::sync::up::UPSafeCell"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.StructuralEq.js b/ch5/trait.impl/core/marker/trait.StructuralEq.js deleted file mode 100644 index 5b32154e..00000000 --- a/ch5/trait.impl/core/marker/trait.StructuralEq.js +++ /dev/null @@ -1,3 +0,0 @@ -(function() {var implementors = { -"os":[["impl StructuralEq for PTEFlags"],["impl StructuralEq for PhysPageNum"],["impl StructuralEq for VirtAddr"],["impl StructuralEq for VirtPageNum"],["impl StructuralEq for PhysAddr"],["impl StructuralEq for MapPermission"]] -};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.StructuralPartialEq.js b/ch5/trait.impl/core/marker/trait.StructuralPartialEq.js index 34ee6744..5f4265a3 100644 --- a/ch5/trait.impl/core/marker/trait.StructuralPartialEq.js +++ b/ch5/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl StructuralPartialEq for PTEFlags"],["impl StructuralPartialEq for MapPermission"],["impl StructuralPartialEq for PhysAddr"],["impl StructuralPartialEq for TaskStatus"],["impl StructuralPartialEq for VirtPageNum"],["impl StructuralPartialEq for MapType"],["impl StructuralPartialEq for PhysPageNum"],["impl StructuralPartialEq for VirtAddr"]] +"os":[["impl StructuralPartialEq for MapType"],["impl StructuralPartialEq for TaskStatus"],["impl StructuralPartialEq for PhysAddr"],["impl StructuralPartialEq for PhysPageNum"],["impl StructuralPartialEq for VirtAddr"],["impl StructuralPartialEq for VirtPageNum"],["impl StructuralPartialEq for MapPermission"],["impl StructuralPartialEq for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.Sync.js b/ch5/trait.impl/core/marker/trait.Sync.js index 78028d0d..f4f20411 100644 --- a/ch5/trait.impl/core/marker/trait.Sync.js +++ b/ch5/trait.impl/core/marker/trait.Sync.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Sync for Stdout",1,["os::console::Stdout"]],["impl Sync for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Sync for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Sync for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Sync for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Sync for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl<T> Sync for SimpleRange<T>
where\n T: Sync,
",1,["os::mm::address::SimpleRange"]],["impl<T> Sync for SimpleRangeIterator<T>
where\n T: Sync,
",1,["os::mm::address::SimpleRangeIterator"]],["impl Sync for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Sync for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Sync for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Sync for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Sync for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Sync for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Sync for MapType",1,["os::mm::memory_set::MapType"]],["impl Sync for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Sync for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Sync for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Sync for PageTable",1,["os::mm::page_table::PageTable"]],["impl Sync for TaskContext",1,["os::task::context::TaskContext"]],["impl Sync for TaskManager",1,["os::task::manager::TaskManager"]],["impl Sync for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Sync for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Sync for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Sync for PidHandle",1,["os::task::pid::PidHandle"]],["impl Sync for KernelStack",1,["os::task::pid::KernelStack"]],["impl Sync for Processor",1,["os::task::processor::Processor"]],["impl Sync for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Sync for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Sync for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Sync for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Sync for INITPROC",1,["os::task::INITPROC"]],["impl Sync for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> Sync for UPSafeCell<T>"]] +"os":[["impl Sync for MapType",1,["os::mm::memory_set::MapType"]],["impl Sync for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Sync for Stdout",1,["os::console::Stdout"]],["impl Sync for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Sync for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Sync for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Sync for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Sync for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl Sync for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Sync for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Sync for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Sync for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Sync for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Sync for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Sync for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Sync for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Sync for PageTable",1,["os::mm::page_table::PageTable"]],["impl Sync for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Sync for TaskContext",1,["os::task::context::TaskContext"]],["impl Sync for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Sync for TaskManager",1,["os::task::manager::TaskManager"]],["impl Sync for KernelStack",1,["os::task::pid::KernelStack"]],["impl Sync for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Sync for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Sync for PidHandle",1,["os::task::pid::PidHandle"]],["impl Sync for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Sync for Processor",1,["os::task::processor::Processor"]],["impl Sync for INITPROC",1,["os::task::INITPROC"]],["impl Sync for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Sync for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Sync for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> Sync for SimpleRange<T>
where\n T: Sync,
",1,["os::mm::address::SimpleRange"]],["impl<T> Sync for SimpleRangeIterator<T>
where\n T: Sync,
",1,["os::mm::address::SimpleRangeIterator"]],["impl<T> Sync for UPSafeCell<T>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/marker/trait.Unpin.js b/ch5/trait.impl/core/marker/trait.Unpin.js index 7f8219fe..bfbbee5d 100644 --- a/ch5/trait.impl/core/marker/trait.Unpin.js +++ b/ch5/trait.impl/core/marker/trait.Unpin.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Unpin for Stdout",1,["os::console::Stdout"]],["impl Unpin for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Unpin for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Unpin for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Unpin for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Unpin for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl<T> Unpin for SimpleRange<T>
where\n T: Unpin,
",1,["os::mm::address::SimpleRange"]],["impl<T> Unpin for SimpleRangeIterator<T>
where\n T: Unpin,
",1,["os::mm::address::SimpleRangeIterator"]],["impl Unpin for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Unpin for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Unpin for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Unpin for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Unpin for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Unpin for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Unpin for MapType",1,["os::mm::memory_set::MapType"]],["impl Unpin for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Unpin for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Unpin for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Unpin for PageTable",1,["os::mm::page_table::PageTable"]],["impl<T> Unpin for UPSafeCell<T>
where\n T: Unpin,
",1,["os::sync::up::UPSafeCell"]],["impl Unpin for TaskContext",1,["os::task::context::TaskContext"]],["impl Unpin for TaskManager",1,["os::task::manager::TaskManager"]],["impl Unpin for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Unpin for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Unpin for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Unpin for PidHandle",1,["os::task::pid::PidHandle"]],["impl Unpin for KernelStack",1,["os::task::pid::KernelStack"]],["impl Unpin for Processor",1,["os::task::processor::Processor"]],["impl Unpin for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Unpin for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Unpin for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Unpin for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Unpin for INITPROC",1,["os::task::INITPROC"]],["impl Unpin for TrapContext",1,["os::trap::context::TrapContext"]]] +"os":[["impl Unpin for MapType",1,["os::mm::memory_set::MapType"]],["impl Unpin for TaskStatus",1,["os::task::task::TaskStatus"]],["impl Unpin for Stdout",1,["os::console::Stdout"]],["impl Unpin for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl Unpin for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl Unpin for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl Unpin for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl Unpin for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl Unpin for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl Unpin for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl Unpin for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl Unpin for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl Unpin for MapArea",1,["os::mm::memory_set::MapArea"]],["impl Unpin for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl Unpin for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl Unpin for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl Unpin for PageTable",1,["os::mm::page_table::PageTable"]],["impl Unpin for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl Unpin for TaskContext",1,["os::task::context::TaskContext"]],["impl Unpin for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl Unpin for TaskManager",1,["os::task::manager::TaskManager"]],["impl Unpin for KernelStack",1,["os::task::pid::KernelStack"]],["impl Unpin for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl Unpin for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl Unpin for PidHandle",1,["os::task::pid::PidHandle"]],["impl Unpin for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl Unpin for Processor",1,["os::task::processor::Processor"]],["impl Unpin for INITPROC",1,["os::task::INITPROC"]],["impl Unpin for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl Unpin for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl Unpin for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> Unpin for SimpleRange<T>
where\n T: Unpin,
",1,["os::mm::address::SimpleRange"]],["impl<T> Unpin for SimpleRangeIterator<T>
where\n T: Unpin,
",1,["os::mm::address::SimpleRangeIterator"]],["impl<T> Unpin for UPSafeCell<T>
where\n T: Unpin,
",1,["os::sync::up::UPSafeCell"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/ops/arith/trait.Sub.js b/ch5/trait.impl/core/ops/arith/trait.Sub.js index 02dddb5c..8a6e7703 100644 --- a/ch5/trait.impl/core/ops/arith/trait.Sub.js +++ b/ch5/trait.impl/core/ops/arith/trait.Sub.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Sub for PTEFlags"],["impl Sub for MapPermission"]] +"os":[["impl Sub for MapPermission"],["impl Sub for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/ops/bit/trait.BitAnd.js b/ch5/trait.impl/core/ops/bit/trait.BitAnd.js index ada33c4e..114d6245 100644 --- a/ch5/trait.impl/core/ops/bit/trait.BitAnd.js +++ b/ch5/trait.impl/core/ops/bit/trait.BitAnd.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl BitAnd for PTEFlags"],["impl BitAnd for MapPermission"]] +"os":[["impl BitAnd for MapPermission"],["impl BitAnd for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/ops/bit/trait.BitAndAssign.js b/ch5/trait.impl/core/ops/bit/trait.BitAndAssign.js index dc6f96b5..86b142a8 100644 --- a/ch5/trait.impl/core/ops/bit/trait.BitAndAssign.js +++ b/ch5/trait.impl/core/ops/bit/trait.BitAndAssign.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl BitAndAssign for PTEFlags"],["impl BitAndAssign for MapPermission"]] +"os":[["impl BitAndAssign for MapPermission"],["impl BitAndAssign for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/ops/bit/trait.BitOrAssign.js b/ch5/trait.impl/core/ops/bit/trait.BitOrAssign.js index 149a9083..549e8c17 100644 --- a/ch5/trait.impl/core/ops/bit/trait.BitOrAssign.js +++ b/ch5/trait.impl/core/ops/bit/trait.BitOrAssign.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl BitOrAssign for PTEFlags"],["impl BitOrAssign for MapPermission"]] +"os":[["impl BitOrAssign for MapPermission"],["impl BitOrAssign for PTEFlags"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/ops/deref/trait.Deref.js b/ch5/trait.impl/core/ops/deref/trait.Deref.js index c3f68739..9555b0d2 100644 --- a/ch5/trait.impl/core/ops/deref/trait.Deref.js +++ b/ch5/trait.impl/core/ops/deref/trait.Deref.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl Deref for PID_ALLOCATOR"],["impl Deref for TASK_MANAGER"],["impl Deref for KERNEL_SPACE"],["impl Deref for PROCESSOR"],["impl Deref for INITPROC"],["impl Deref for APP_NAMES"],["impl Deref for FRAME_ALLOCATOR"]] +"os":[["impl Deref for APP_NAMES"],["impl Deref for FRAME_ALLOCATOR"],["impl Deref for KERNEL_SPACE"],["impl Deref for TASK_MANAGER"],["impl Deref for PID_ALLOCATOR"],["impl Deref for PROCESSOR"],["impl Deref for INITPROC"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/ch5/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js index 1ba5a381..210443bd 100644 --- a/ch5/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/ch5/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl RefUnwindSafe for Stdout",1,["os::console::Stdout"]],["impl RefUnwindSafe for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl RefUnwindSafe for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl RefUnwindSafe for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl RefUnwindSafe for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl RefUnwindSafe for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl<T> RefUnwindSafe for SimpleRange<T>
where\n T: RefUnwindSafe,
",1,["os::mm::address::SimpleRange"]],["impl<T> RefUnwindSafe for SimpleRangeIterator<T>
where\n T: RefUnwindSafe,
",1,["os::mm::address::SimpleRangeIterator"]],["impl RefUnwindSafe for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl RefUnwindSafe for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl RefUnwindSafe for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl RefUnwindSafe for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl RefUnwindSafe for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl RefUnwindSafe for MapArea",1,["os::mm::memory_set::MapArea"]],["impl RefUnwindSafe for MapType",1,["os::mm::memory_set::MapType"]],["impl RefUnwindSafe for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl RefUnwindSafe for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl RefUnwindSafe for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl RefUnwindSafe for PageTable",1,["os::mm::page_table::PageTable"]],["impl<T> !RefUnwindSafe for UPSafeCell<T>",1,["os::sync::up::UPSafeCell"]],["impl RefUnwindSafe for TaskContext",1,["os::task::context::TaskContext"]],["impl !RefUnwindSafe for TaskManager",1,["os::task::manager::TaskManager"]],["impl RefUnwindSafe for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl RefUnwindSafe for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl RefUnwindSafe for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl RefUnwindSafe for PidHandle",1,["os::task::pid::PidHandle"]],["impl RefUnwindSafe for KernelStack",1,["os::task::pid::KernelStack"]],["impl !RefUnwindSafe for Processor",1,["os::task::processor::Processor"]],["impl RefUnwindSafe for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl !RefUnwindSafe for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl !RefUnwindSafe for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl RefUnwindSafe for TaskStatus",1,["os::task::task::TaskStatus"]],["impl RefUnwindSafe for INITPROC",1,["os::task::INITPROC"]],["impl RefUnwindSafe for TrapContext",1,["os::trap::context::TrapContext"]]] +"os":[["impl !RefUnwindSafe for TaskManager",1,["os::task::manager::TaskManager"]],["impl !RefUnwindSafe for Processor",1,["os::task::processor::Processor"]],["impl !RefUnwindSafe for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl !RefUnwindSafe for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl RefUnwindSafe for MapType",1,["os::mm::memory_set::MapType"]],["impl RefUnwindSafe for TaskStatus",1,["os::task::task::TaskStatus"]],["impl RefUnwindSafe for Stdout",1,["os::console::Stdout"]],["impl RefUnwindSafe for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl RefUnwindSafe for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl RefUnwindSafe for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl RefUnwindSafe for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl RefUnwindSafe for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl RefUnwindSafe for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl RefUnwindSafe for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl RefUnwindSafe for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl RefUnwindSafe for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl RefUnwindSafe for MapArea",1,["os::mm::memory_set::MapArea"]],["impl RefUnwindSafe for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl RefUnwindSafe for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl RefUnwindSafe for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl RefUnwindSafe for PageTable",1,["os::mm::page_table::PageTable"]],["impl RefUnwindSafe for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl RefUnwindSafe for TaskContext",1,["os::task::context::TaskContext"]],["impl RefUnwindSafe for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl RefUnwindSafe for KernelStack",1,["os::task::pid::KernelStack"]],["impl RefUnwindSafe for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl RefUnwindSafe for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl RefUnwindSafe for PidHandle",1,["os::task::pid::PidHandle"]],["impl RefUnwindSafe for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl RefUnwindSafe for INITPROC",1,["os::task::INITPROC"]],["impl RefUnwindSafe for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> !RefUnwindSafe for UPSafeCell<T>",1,["os::sync::up::UPSafeCell"]],["impl<T> RefUnwindSafe for SimpleRange<T>
where\n T: RefUnwindSafe,
",1,["os::mm::address::SimpleRange"]],["impl<T> RefUnwindSafe for SimpleRangeIterator<T>
where\n T: RefUnwindSafe,
",1,["os::mm::address::SimpleRangeIterator"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/ch5/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js index 69c17555..03537da2 100644 --- a/ch5/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/ch5/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl UnwindSafe for Stdout",1,["os::console::Stdout"]],["impl UnwindSafe for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl UnwindSafe for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl UnwindSafe for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl UnwindSafe for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl UnwindSafe for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl<T> UnwindSafe for SimpleRange<T>
where\n T: UnwindSafe,
",1,["os::mm::address::SimpleRange"]],["impl<T> UnwindSafe for SimpleRangeIterator<T>
where\n T: UnwindSafe,
",1,["os::mm::address::SimpleRangeIterator"]],["impl UnwindSafe for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl UnwindSafe for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl UnwindSafe for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl UnwindSafe for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl UnwindSafe for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl UnwindSafe for MapArea",1,["os::mm::memory_set::MapArea"]],["impl UnwindSafe for MapType",1,["os::mm::memory_set::MapType"]],["impl UnwindSafe for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl UnwindSafe for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl UnwindSafe for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl UnwindSafe for PageTable",1,["os::mm::page_table::PageTable"]],["impl<T> UnwindSafe for UPSafeCell<T>
where\n T: UnwindSafe,
",1,["os::sync::up::UPSafeCell"]],["impl UnwindSafe for TaskContext",1,["os::task::context::TaskContext"]],["impl !UnwindSafe for TaskManager",1,["os::task::manager::TaskManager"]],["impl UnwindSafe for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl UnwindSafe for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl UnwindSafe for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl UnwindSafe for PidHandle",1,["os::task::pid::PidHandle"]],["impl UnwindSafe for KernelStack",1,["os::task::pid::KernelStack"]],["impl !UnwindSafe for Processor",1,["os::task::processor::Processor"]],["impl UnwindSafe for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl !UnwindSafe for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl !UnwindSafe for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl UnwindSafe for TaskStatus",1,["os::task::task::TaskStatus"]],["impl UnwindSafe for INITPROC",1,["os::task::INITPROC"]],["impl UnwindSafe for TrapContext",1,["os::trap::context::TrapContext"]]] +"os":[["impl !UnwindSafe for TaskManager",1,["os::task::manager::TaskManager"]],["impl !UnwindSafe for Processor",1,["os::task::processor::Processor"]],["impl !UnwindSafe for TaskControlBlock",1,["os::task::task::TaskControlBlock"]],["impl !UnwindSafe for TaskControlBlockInner",1,["os::task::task::TaskControlBlockInner"]],["impl UnwindSafe for MapType",1,["os::mm::memory_set::MapType"]],["impl UnwindSafe for TaskStatus",1,["os::task::task::TaskStatus"]],["impl UnwindSafe for Stdout",1,["os::console::Stdout"]],["impl UnwindSafe for APP_NAMES",1,["os::loader::APP_NAMES"]],["impl UnwindSafe for PhysAddr",1,["os::mm::address::PhysAddr"]],["impl UnwindSafe for PhysPageNum",1,["os::mm::address::PhysPageNum"]],["impl UnwindSafe for VirtAddr",1,["os::mm::address::VirtAddr"]],["impl UnwindSafe for VirtPageNum",1,["os::mm::address::VirtPageNum"]],["impl UnwindSafe for FRAME_ALLOCATOR",1,["os::mm::frame_allocator::FRAME_ALLOCATOR"]],["impl UnwindSafe for FrameTracker",1,["os::mm::frame_allocator::FrameTracker"]],["impl UnwindSafe for StackFrameAllocator",1,["os::mm::frame_allocator::StackFrameAllocator"]],["impl UnwindSafe for KERNEL_SPACE",1,["os::mm::memory_set::KERNEL_SPACE"]],["impl UnwindSafe for MapArea",1,["os::mm::memory_set::MapArea"]],["impl UnwindSafe for MapPermission",1,["os::mm::memory_set::MapPermission"]],["impl UnwindSafe for MemorySet",1,["os::mm::memory_set::MemorySet"]],["impl UnwindSafe for PTEFlags",1,["os::mm::page_table::PTEFlags"]],["impl UnwindSafe for PageTable",1,["os::mm::page_table::PageTable"]],["impl UnwindSafe for PageTableEntry",1,["os::mm::page_table::PageTableEntry"]],["impl UnwindSafe for TaskContext",1,["os::task::context::TaskContext"]],["impl UnwindSafe for TASK_MANAGER",1,["os::task::manager::TASK_MANAGER"]],["impl UnwindSafe for KernelStack",1,["os::task::pid::KernelStack"]],["impl UnwindSafe for PID_ALLOCATOR",1,["os::task::pid::PID_ALLOCATOR"]],["impl UnwindSafe for PidAllocator",1,["os::task::pid::PidAllocator"]],["impl UnwindSafe for PidHandle",1,["os::task::pid::PidHandle"]],["impl UnwindSafe for PROCESSOR",1,["os::task::processor::PROCESSOR"]],["impl UnwindSafe for INITPROC",1,["os::task::INITPROC"]],["impl UnwindSafe for TrapContext",1,["os::trap::context::TrapContext"]],["impl<T> UnwindSafe for SimpleRange<T>
where\n T: UnwindSafe,
",1,["os::mm::address::SimpleRange"]],["impl<T> UnwindSafe for SimpleRangeIterator<T>
where\n T: UnwindSafe,
",1,["os::mm::address::SimpleRangeIterator"]],["impl<T> UnwindSafe for UPSafeCell<T>
where\n T: UnwindSafe,
",1,["os::sync::up::UPSafeCell"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/trait.impl/lazy_static/trait.LazyStatic.js b/ch5/trait.impl/lazy_static/trait.LazyStatic.js index c8f1073a..9113c7a5 100644 --- a/ch5/trait.impl/lazy_static/trait.LazyStatic.js +++ b/ch5/trait.impl/lazy_static/trait.LazyStatic.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"os":[["impl LazyStatic for PID_ALLOCATOR"],["impl LazyStatic for KERNEL_SPACE"],["impl LazyStatic for APP_NAMES"],["impl LazyStatic for INITPROC"],["impl LazyStatic for FRAME_ALLOCATOR"],["impl LazyStatic for TASK_MANAGER"],["impl LazyStatic for PROCESSOR"]] +"os":[["impl LazyStatic for APP_NAMES"],["impl LazyStatic for FRAME_ALLOCATOR"],["impl LazyStatic for KERNEL_SPACE"],["impl LazyStatic for TASK_MANAGER"],["impl LazyStatic for PID_ALLOCATOR"],["impl LazyStatic for PROCESSOR"],["impl LazyStatic for INITPROC"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/ch5/type.impl/os/mm/address/struct.SimpleRange.js b/ch5/type.impl/os/mm/address/struct.SimpleRange.js index e0ef3d22..ac86586c 100644 --- a/ch5/type.impl/os/mm/address/struct.SimpleRange.js +++ b/ch5/type.impl/os/mm/address/struct.SimpleRange.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"os":[["
source§

impl<T> SimpleRange<T>

source

pub fn new(start: T, end: T) -> Self

source

pub fn get_start(&self) -> T

source

pub fn get_end(&self) -> T

",0,"os::mm::address::VPNRange"],["
source§

impl<T> Copy for SimpleRange<T>

","Copy","os::mm::address::VPNRange"],["
source§

impl<T> Clone for SimpleRange<T>

source§

fn clone(&self) -> SimpleRange<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","os::mm::address::VPNRange"],["
source§

impl<T> IntoIterator for SimpleRange<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = SimpleRangeIterator<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
","IntoIterator","os::mm::address::VPNRange"]] +"os":[["
source§

impl<T> Clone for SimpleRange<T>

source§

fn clone(&self) -> SimpleRange<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
","Clone","os::mm::address::VPNRange"],["
source§

impl<T> IntoIterator for SimpleRange<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = SimpleRangeIterator<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
","IntoIterator","os::mm::address::VPNRange"],["
source§

impl<T> SimpleRange<T>

source

pub fn new(start: T, end: T) -> Self

source

pub fn get_start(&self) -> T

source

pub fn get_end(&self) -> T

",0,"os::mm::address::VPNRange"],["
source§

impl<T> Copy for SimpleRange<T>

","Copy","os::mm::address::VPNRange"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/ch5/type.impl/os/mm/frame_allocator/struct.StackFrameAllocator.js b/ch5/type.impl/os/mm/frame_allocator/struct.StackFrameAllocator.js index 239ba7d6..96635262 100644 --- a/ch5/type.impl/os/mm/frame_allocator/struct.StackFrameAllocator.js +++ b/ch5/type.impl/os/mm/frame_allocator/struct.StackFrameAllocator.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"os":[["
source§

impl StackFrameAllocator

source

pub fn init(&mut self, l: PhysPageNum, r: PhysPageNum)

",0,"os::mm::frame_allocator::FrameAllocatorImpl"],["
source§

impl FrameAllocator for StackFrameAllocator

source§

fn new() -> Self

source§

fn alloc(&mut self) -> Option<PhysPageNum>

source§

fn dealloc(&mut self, ppn: PhysPageNum)

","FrameAllocator","os::mm::frame_allocator::FrameAllocatorImpl"]] +"os":[["
source§

impl FrameAllocator for StackFrameAllocator

source§

fn new() -> Self

source§

fn alloc(&mut self) -> Option<PhysPageNum>

source§

fn dealloc(&mut self, ppn: PhysPageNum)

","FrameAllocator","os::mm::frame_allocator::FrameAllocatorImpl"],["
source§

impl StackFrameAllocator

source

pub fn init(&mut self, l: PhysPageNum, r: PhysPageNum)

",0,"os::mm::frame_allocator::FrameAllocatorImpl"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file