diff --git a/.lock b/.lock new file mode 100644 index 0000000..e69de29 diff --git a/crates.js b/crates.js new file mode 100644 index 0000000..241c46c --- /dev/null +++ b/crates.js @@ -0,0 +1 @@ +window.ALL_CRATES = ["page_table_entry","page_table_multiarch"]; \ No newline at end of file diff --git a/help.html b/help.html new file mode 100644 index 0000000..2fbce19 --- /dev/null +++ b/help.html @@ -0,0 +1 @@ +Help

Rustdoc help

Back
\ No newline at end of file diff --git a/index.html b/index.html new file mode 100644 index 0000000..25f14ff --- /dev/null +++ b/index.html @@ -0,0 +1 @@ +Index of crates

List of all crates

\ No newline at end of file diff --git a/page_table_entry/aarch64/enum.MemAttr.html b/page_table_entry/aarch64/enum.MemAttr.html new file mode 100644 index 0000000..30311ac --- /dev/null +++ b/page_table_entry/aarch64/enum.MemAttr.html @@ -0,0 +1,26 @@ +MemAttr in page_table_entry::aarch64 - Rust

Enum page_table_entry::aarch64::MemAttr

source ·
#[repr(u64)]
pub enum MemAttr { + Device = 0, + Normal = 1, + NormalNonCacheable = 2, +}
Available on AArch64 only.
Expand description

The memory attributes index field in the descriptor, which is used to index +into the MAIR (Memory Attribute Indirection Register).

+

Variants§

§

Device = 0

Device-nGnRE memory

+
§

Normal = 1

Normal memory

+
§

NormalNonCacheable = 2

Normal non-cacheable memory

+

Implementations§

source§

impl MemAttr

source

pub const MAIR_VALUE: u64 = 4_521_732u64

The MAIR_ELx register should be set to this value to match the memory +attributes in the descriptors.

+

Trait Implementations§

source§

impl Clone for MemAttr

source§

fn clone(&self) -> MemAttr

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 MemAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for MemAttr

source§

fn eq(&self, other: &MemAttr) -> 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 MemAttr

source§

impl Eq for MemAttr

source§

impl StructuralPartialEq for MemAttr

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_entry/aarch64/index.html b/page_table_entry/aarch64/index.html new file mode 100644 index 0000000..1d7a99c --- /dev/null +++ b/page_table_entry/aarch64/index.html @@ -0,0 +1,3 @@ +page_table_entry::aarch64 - Rust

Module page_table_entry::aarch64

source ·
Available on AArch64 only.
Expand description

AArch64 VMSAv8-64 translation table format descriptors.

+

Structs§

  • A VMSAv8-64 translation table descriptor.
  • Memory attribute fields in the VMSAv8-64 translation table format descriptors.

Enums§

  • The memory attributes index field in the descriptor, which is used to index +into the MAIR (Memory Attribute Indirection Register).
\ No newline at end of file diff --git a/page_table_entry/aarch64/sidebar-items.js b/page_table_entry/aarch64/sidebar-items.js new file mode 100644 index 0000000..4721690 --- /dev/null +++ b/page_table_entry/aarch64/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["MemAttr"],"struct":["A64PTE","DescriptorAttr"]}; \ No newline at end of file diff --git a/page_table_entry/aarch64/struct.A64PTE.html b/page_table_entry/aarch64/struct.A64PTE.html new file mode 100644 index 0000000..fe613f8 --- /dev/null +++ b/page_table_entry/aarch64/struct.A64PTE.html @@ -0,0 +1,19 @@ +A64PTE in page_table_entry::aarch64 - Rust

Struct page_table_entry::aarch64::A64PTE

source ·
pub struct A64PTE(/* private fields */);
Available on AArch64 only.
Expand description

A VMSAv8-64 translation table descriptor.

+

Note that the AttrIndx[2:0] (bit[4:2]) field is set to 0 for device +memory, and 1 for normal memory. The system must configure the MAIR_ELx +system register accordingly.

+

Implementations§

source§

impl A64PTE

source

pub const fn empty() -> Self

Creates an empty descriptor with all bits set to zero.

+

Trait Implementations§

source§

impl Clone for A64PTE

source§

fn clone(&self) -> A64PTE

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 A64PTE

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl GenericPTE for A64PTE

source§

fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self

Creates a page table entry point to a terminate page or block.
source§

fn new_table(paddr: PhysAddr) -> Self

Creates a page table entry point to a next level page table.
source§

fn paddr(&self) -> PhysAddr

Returns the physical address mapped by this entry.
source§

fn flags(&self) -> MappingFlags

Returns the flags of this entry.
source§

fn set_paddr(&mut self, paddr: PhysAddr)

Set mapped physical address of the entry.
source§

fn set_flags(&mut self, flags: MappingFlags, is_huge: bool)

Set flags of the entry.
source§

fn bits(self) -> usize

Returns the raw bits of this entry.
source§

fn is_unused(&self) -> bool

Returns whether this entry is zero.
source§

fn is_present(&self) -> bool

Returns whether this entry flag indicates present.
source§

fn is_huge(&self) -> bool

For non-last level translation, returns whether this entry maps to a +huge frame.
source§

fn clear(&mut self)

Set this entry to zero.
source§

impl Copy for A64PTE

Auto Trait Implementations§

§

impl Freeze for A64PTE

§

impl RefUnwindSafe for A64PTE

§

impl Send for A64PTE

§

impl Sync for A64PTE

§

impl Unpin for A64PTE

§

impl UnwindSafe for A64PTE

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_entry/aarch64/struct.DescriptorAttr.html b/page_table_entry/aarch64/struct.DescriptorAttr.html new file mode 100644 index 0000000..8c589b3 --- /dev/null +++ b/page_table_entry/aarch64/struct.DescriptorAttr.html @@ -0,0 +1,91 @@ +DescriptorAttr in page_table_entry::aarch64 - Rust

Struct page_table_entry::aarch64::DescriptorAttr

source ·
pub struct DescriptorAttr(/* private fields */);
Available on AArch64 only.
Expand description

Memory attribute fields in the VMSAv8-64 translation table format descriptors.

+

Implementations§

source§

impl DescriptorAttr

source

pub const VALID: Self = _

Whether the descriptor is valid.

+
source

pub const NON_BLOCK: Self = _

The descriptor gives the address of the next level of translation table or 4KB page. +(not a 2M, 1G block)

+
source

pub const ATTR_INDX: Self = _

Memory attributes index field.

+
source

pub const NS: Self = _

Non-secure bit. For memory accesses from Secure state, specifies whether the output +address is in Secure or Non-secure memory.

+
source

pub const AP_EL0: Self = _

Access permission: accessable at EL0.

+
source

pub const AP_RO: Self = _

Access permission: read-only.

+
source

pub const INNER: Self = _

Shareability: Inner Shareable (otherwise Outer Shareable).

+
source

pub const SHAREABLE: Self = _

Shareability: Inner or Outer Shareable (otherwise Non-shareable).

+
source

pub const AF: Self = _

The Access flag.

+
source

pub const NG: Self = _

The not global bit.

+
source

pub const CONTIGUOUS: Self = _

Indicates that 16 adjacent translation table entries point to contiguous memory regions.

+
source

pub const PXN: Self = _

The Privileged execute-never field.

+
source

pub const UXN: Self = _

The Execute-never or Unprivileged execute-never field.

+
source

pub const PXN_TABLE: Self = _

PXN limit for subsequent levels of lookup.

+
source

pub const XN_TABLE: Self = _

XN limit for subsequent levels of lookup.

+
source

pub const AP_NO_EL0_TABLE: Self = _

Access permissions limit for subsequent levels of lookup: access at EL0 not permitted.

+
source

pub const AP_NO_WRITE_TABLE: Self = _

Access permissions limit for subsequent levels of lookup: write access not permitted.

+
source

pub const NS_TABLE: Self = _

For memory accesses from Secure state, specifies the Security state for subsequent +levels of lookup.

+
source§

impl DescriptorAttr

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> u64

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: u64) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: u64) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: u64) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl DescriptorAttr

source

pub const fn iter(&self) -> Iter<DescriptorAttr>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<DescriptorAttr>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+
source§

impl DescriptorAttr

source

pub const fn from_mem_attr(idx: MemAttr) -> Self

Constructs a descriptor from the memory index, leaving the other fields +empty.

+
source

pub const fn mem_attr(&self) -> Option<MemAttr>

Returns the memory attribute index field.

+

Trait Implementations§

source§

impl Binary for DescriptorAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl BitAnd for DescriptorAttr

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = DescriptorAttr

The resulting type after applying the & operator.
source§

impl BitAndAssign for DescriptorAttr

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for DescriptorAttr

source§

fn bitor(self, other: DescriptorAttr) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = DescriptorAttr

The resulting type after applying the | operator.
source§

impl BitOrAssign for DescriptorAttr

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for DescriptorAttr

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = DescriptorAttr

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for DescriptorAttr

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Debug for DescriptorAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<DescriptorAttr> for DescriptorAttr

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
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 Flags for DescriptorAttr

source§

const FLAGS: &'static [Flag<DescriptorAttr>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
source§

fn bits(&self) -> u64

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: u64) -> DescriptorAttr

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> bool
where + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> bool
where + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)
where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)
where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)
where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)
where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<DescriptorAttr> for MappingFlags

source§

fn from(attr: DescriptorAttr) -> Self

Converts to this type from the input type.
source§

impl From<MappingFlags> for DescriptorAttr

source§

fn from(flags: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl FromIterator<DescriptorAttr> for DescriptorAttr

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for DescriptorAttr

§

type Item = DescriptorAttr

The type of the elements being iterated over.
§

type IntoIter = Iter<DescriptorAttr>

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 LowerHex for DescriptorAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Not for DescriptorAttr

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = DescriptorAttr

The resulting type after applying the ! operator.
source§

impl Octal for DescriptorAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PublicFlags for DescriptorAttr

§

type Primitive = u64

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for DescriptorAttr

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = DescriptorAttr

The resulting type after applying the - operator.
source§

impl SubAssign for DescriptorAttr

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for DescriptorAttr

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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).

+

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 diff --git a/page_table_entry/all.html b/page_table_entry/all.html new file mode 100644 index 0000000..767a7ea --- /dev/null +++ b/page_table_entry/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

\ No newline at end of file diff --git a/page_table_entry/arch/aarch64/enum.MemAttr.html b/page_table_entry/arch/aarch64/enum.MemAttr.html new file mode 100644 index 0000000..3cb438b --- /dev/null +++ b/page_table_entry/arch/aarch64/enum.MemAttr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/aarch64/enum.MemAttr.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/aarch64/index.html b/page_table_entry/arch/aarch64/index.html new file mode 100644 index 0000000..b5c339b --- /dev/null +++ b/page_table_entry/arch/aarch64/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/aarch64/index.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/aarch64/struct.A64PTE.html b/page_table_entry/arch/aarch64/struct.A64PTE.html new file mode 100644 index 0000000..a314ba1 --- /dev/null +++ b/page_table_entry/arch/aarch64/struct.A64PTE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/aarch64/struct.A64PTE.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/aarch64/struct.DescriptorAttr.html b/page_table_entry/arch/aarch64/struct.DescriptorAttr.html new file mode 100644 index 0000000..3bf37c6 --- /dev/null +++ b/page_table_entry/arch/aarch64/struct.DescriptorAttr.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/aarch64/struct.DescriptorAttr.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/riscv/index.html b/page_table_entry/arch/riscv/index.html new file mode 100644 index 0000000..33e2517 --- /dev/null +++ b/page_table_entry/arch/riscv/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/riscv/index.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/riscv/struct.PTEFlags.html b/page_table_entry/arch/riscv/struct.PTEFlags.html new file mode 100644 index 0000000..fffbb54 --- /dev/null +++ b/page_table_entry/arch/riscv/struct.PTEFlags.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/riscv/struct.PTEFlags.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/riscv/struct.Rv64PTE.html b/page_table_entry/arch/riscv/struct.Rv64PTE.html new file mode 100644 index 0000000..f5d10b3 --- /dev/null +++ b/page_table_entry/arch/riscv/struct.Rv64PTE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/riscv/struct.Rv64PTE.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/x86_64/index.html b/page_table_entry/arch/x86_64/index.html new file mode 100644 index 0000000..f1e816d --- /dev/null +++ b/page_table_entry/arch/x86_64/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/x86_64/index.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/x86_64/struct.PTF.html b/page_table_entry/arch/x86_64/struct.PTF.html new file mode 100644 index 0000000..b1d7250 --- /dev/null +++ b/page_table_entry/arch/x86_64/struct.PTF.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/x86_64/struct.PTF.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/arch/x86_64/struct.X64PTE.html b/page_table_entry/arch/x86_64/struct.X64PTE.html new file mode 100644 index 0000000..a08d2e6 --- /dev/null +++ b/page_table_entry/arch/x86_64/struct.X64PTE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_entry/x86_64/struct.X64PTE.html...

+ + + \ No newline at end of file diff --git a/page_table_entry/index.html b/page_table_entry/index.html new file mode 100644 index 0000000..57950e5 --- /dev/null +++ b/page_table_entry/index.html @@ -0,0 +1,32 @@ +page_table_entry - Rust

Crate page_table_entry

source ·
Expand description

§page_table_entry

+

Crates.io

+

This crate provides the definition of page table entry for various hardware +architectures.

+

Currently supported architectures and page table entry types:

+ +

All these types implement the GenericPTE trait, which provides unified +methods for manipulating various page table entries.

+

§Examples (x86_64)

+
use memory_addr::PhysAddr;
+use x86_64::structures::paging::page_table::PageTableFlags;
+use page_table_entry::{GenericPTE, MappingFlags, x86_64::X64PTE};
+
+let paddr = PhysAddr::from(0x233000);
+let pte = X64PTE::new_page(
+    paddr,
+    /* flags: */ MappingFlags::READ | MappingFlags::WRITE,
+    /* is_huge: */ false,
+);
+assert!(!pte.is_unused());
+assert!(pte.is_present());
+assert_eq!(pte.paddr(), paddr);
+assert_eq!(
+    pte.bits(),
+    0x800_0000000233_003, // PRESENT | WRITE | NO_EXECUTE | paddr(0x233000)
+);
+

Modules§

  • aarch64AArch64
    AArch64 VMSAv8-64 translation table format descriptors.
  • riscvRISC-V RV32 or RISC-V RV64
    RISC-V page table entries.
  • x86_64x86-64
    x86 page table entries on 64-bit paging.

Structs§

  • Generic page table entry flags that indicate the corresponding mapped +memory region permissions and attributes.

Traits§

\ No newline at end of file diff --git a/page_table_entry/riscv/index.html b/page_table_entry/riscv/index.html new file mode 100644 index 0000000..040f94a --- /dev/null +++ b/page_table_entry/riscv/index.html @@ -0,0 +1,2 @@ +page_table_entry::riscv - Rust

Module page_table_entry::riscv

source ·
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

RISC-V page table entries.

+

Structs§

  • Page-table entry flags.
  • Sv39 and Sv48 page table entry for RV64 systems.
\ No newline at end of file diff --git a/page_table_entry/riscv/sidebar-items.js b/page_table_entry/riscv/sidebar-items.js new file mode 100644 index 0000000..8695ae2 --- /dev/null +++ b/page_table_entry/riscv/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["PTEFlags","Rv64PTE"]}; \ No newline at end of file diff --git a/page_table_entry/riscv/struct.PTEFlags.html b/page_table_entry/riscv/struct.PTEFlags.html new file mode 100644 index 0000000..bb9c389 --- /dev/null +++ b/page_table_entry/riscv/struct.PTEFlags.html @@ -0,0 +1,77 @@ +PTEFlags in page_table_entry::riscv - Rust

Struct page_table_entry::riscv::PTEFlags

source ·
pub struct PTEFlags(/* private fields */);
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

Page-table entry flags.

+

Implementations§

source§

impl PTEFlags

source

pub const V: Self = _

Whether the PTE is valid.

+
source

pub const R: Self = _

Whether the page is readable.

+
source

pub const W: Self = _

Whether the page is writable.

+
source

pub const X: Self = _

Whether the page is executable.

+
source

pub const U: Self = _

Whether the page is accessible to user mode.

+
source

pub const G: Self = _

Designates a global mapping.

+
source

pub const A: Self = _

Indicates the virtual page has been read, written, or fetched from +since the last time the A bit was cleared.

+
source

pub const D: Self = _

Indicates the virtual page has been written since the last time the +D bit was cleared.

+
source§

impl PTEFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> usize

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: usize) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: usize) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: usize) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl PTEFlags

source

pub const fn iter(&self) -> Iter<PTEFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<PTEFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl BitAnd for PTEFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = PTEFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for PTEFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for PTEFlags

source§

fn bitor(self, other: PTEFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = PTEFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for PTEFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for PTEFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = PTEFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for PTEFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
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)

The bitwise or (|) of the bits in each flags value.

+
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 Flags for PTEFlags

source§

const FLAGS: &'static [Flag<PTEFlags>] = _

The set of defined flags.
§

type Bits = usize

The underlying bits type.
source§

fn bits(&self) -> usize

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: usize) -> PTEFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> bool
where + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> bool
where + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)
where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)
where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)
where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)
where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<MappingFlags> for PTEFlags

source§

fn from(f: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<PTEFlags> for MappingFlags

source§

fn from(f: PTEFlags) -> Self

Converts to this type from the input type.
source§

impl FromIterator<PTEFlags> for PTEFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for PTEFlags

§

type Item = PTEFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<PTEFlags>

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 LowerHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Not for PTEFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

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. Read more
source§

impl PublicFlags for PTEFlags

§

type Primitive = usize

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for PTEFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = PTEFlags

The resulting type after applying the - operator.
source§

impl SubAssign for PTEFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for PTEFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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).

+

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 diff --git a/page_table_entry/riscv/struct.Rv64PTE.html b/page_table_entry/riscv/struct.Rv64PTE.html new file mode 100644 index 0000000..cc062c4 --- /dev/null +++ b/page_table_entry/riscv/struct.Rv64PTE.html @@ -0,0 +1,15 @@ +Rv64PTE in page_table_entry::riscv - Rust

Struct page_table_entry::riscv::Rv64PTE

source ·
pub struct Rv64PTE(/* private fields */);
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

Sv39 and Sv48 page table entry for RV64 systems.

+

Trait Implementations§

source§

impl Clone for Rv64PTE

source§

fn clone(&self) -> Rv64PTE

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 Rv64PTE

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl GenericPTE for Rv64PTE

source§

fn new_page(paddr: PhysAddr, flags: MappingFlags, _is_huge: bool) -> Self

Creates a page table entry point to a terminate page or block.
source§

fn new_table(paddr: PhysAddr) -> Self

Creates a page table entry point to a next level page table.
source§

fn paddr(&self) -> PhysAddr

Returns the physical address mapped by this entry.
source§

fn flags(&self) -> MappingFlags

Returns the flags of this entry.
source§

fn set_paddr(&mut self, paddr: PhysAddr)

Set mapped physical address of the entry.
source§

fn set_flags(&mut self, flags: MappingFlags, _is_huge: bool)

Set flags of the entry.
source§

fn bits(self) -> usize

Returns the raw bits of this entry.
source§

fn is_unused(&self) -> bool

Returns whether this entry is zero.
source§

fn is_present(&self) -> bool

Returns whether this entry flag indicates present.
source§

fn is_huge(&self) -> bool

For non-last level translation, returns whether this entry maps to a +huge frame.
source§

fn clear(&mut self)

Set this entry to zero.
source§

impl Copy for Rv64PTE

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_entry/sidebar-items.js b/page_table_entry/sidebar-items.js new file mode 100644 index 0000000..4457c40 --- /dev/null +++ b/page_table_entry/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["aarch64","riscv","x86_64"],"struct":["MappingFlags"],"trait":["GenericPTE"]}; \ No newline at end of file diff --git a/page_table_entry/struct.MappingFlags.html b/page_table_entry/struct.MappingFlags.html new file mode 100644 index 0000000..1926b25 --- /dev/null +++ b/page_table_entry/struct.MappingFlags.html @@ -0,0 +1,78 @@ +MappingFlags in page_table_entry - Rust

Struct page_table_entry::MappingFlags

source ·
pub struct MappingFlags(/* private fields */);
Expand description

Generic page table entry flags that indicate the corresponding mapped +memory region permissions and attributes.

+

Implementations§

source§

impl MappingFlags

source

pub const READ: Self = _

The memory is readable.

+
source

pub const WRITE: Self = _

The memory is writable.

+
source

pub const EXECUTE: Self = _

The memory is executable.

+
source

pub const USER: Self = _

The memory is user accessible.

+
source

pub const DEVICE: Self = _

The memory is device memory.

+
source

pub const UNCACHED: Self = _

The memory is uncached.

+
source§

impl MappingFlags

source

pub const fn empty() -> Self

Get a flags value with all bits unset.

+
source

pub const fn all() -> Self

Get a flags value with all known bits set.

+
source

pub const fn bits(&self) -> usize

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+
source

pub const fn from_bits(bits: usize) -> Option<Self>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+
source

pub const fn from_bits_truncate(bits: usize) -> Self

Convert from a bits value, unsetting any unknown bits.

+
source

pub const fn from_bits_retain(bits: usize) -> Self

Convert from a bits value exactly.

+
source

pub fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+
source

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+
source

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+
source

pub const fn intersects(&self, other: Self) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+
source

pub const fn contains(&self, other: Self) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+
source

pub fn insert(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source

pub fn remove(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+
source

pub fn toggle(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub fn set(&mut self, other: Self, value: bool)

Call insert when value is true or remove when value is false.

+
source

pub const fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
source

pub const fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.

+
source

pub const fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source

pub const fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
source

pub const fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
source§

impl MappingFlags

source

pub const fn iter(&self) -> Iter<MappingFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+
source

pub const fn iter_names(&self) -> IterNames<MappingFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

source§

impl Binary for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl BitAnd for MappingFlags

source§

fn bitand(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the & operator.
source§

impl BitAndAssign for MappingFlags

source§

fn bitand_assign(&mut self, other: Self)

The bitwise and (&) of the bits in two flags values.

+
source§

impl BitOr for MappingFlags

source§

fn bitor(self, other: MappingFlags) -> Self

The bitwise or (|) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the | operator.
source§

impl BitOrAssign for MappingFlags

source§

fn bitor_assign(&mut self, other: Self)

The bitwise or (|) of the bits in two flags values.

+
source§

impl BitXor for MappingFlags

source§

fn bitxor(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = MappingFlags

The resulting type after applying the ^ operator.
source§

impl BitXorAssign for MappingFlags

source§

fn bitxor_assign(&mut self, other: Self)

The bitwise exclusive-or (^) of the bits in two flags values.

+
source§

impl Clone for MappingFlags

source§

fn clone(&self) -> MappingFlags

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 MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Extend<MappingFlags> for MappingFlags

source§

fn extend<T: IntoIterator<Item = Self>>(&mut self, iterator: T)

The bitwise or (|) of the bits in each flags value.

+
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 Flags for MappingFlags

source§

const FLAGS: &'static [Flag<MappingFlags>] = _

The set of defined flags.
§

type Bits = usize

The underlying bits type.
source§

fn bits(&self) -> usize

Get the underlying bits value. Read more
source§

fn from_bits_retain(bits: usize) -> MappingFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> bool
where + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> bool
where + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)
where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)
where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)
where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)
where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<DescriptorAttr> for MappingFlags

Available on AArch64 only.
source§

fn from(attr: DescriptorAttr) -> Self

Converts to this type from the input type.
source§

impl From<MappingFlags> for DescriptorAttr

Available on AArch64 only.
source§

fn from(flags: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<MappingFlags> for PTEFlags

Available on RISC-V RV32 or RISC-V RV64 only.
source§

fn from(f: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<MappingFlags> for PTF

Available on x86-64 only.
source§

fn from(f: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<PTEFlags> for MappingFlags

Available on RISC-V RV32 or RISC-V RV64 only.
source§

fn from(f: PTEFlags) -> Self

Converts to this type from the input type.
source§

impl From<PageTableFlags> for MappingFlags

Available on x86-64 only.
source§

fn from(f: PTF) -> Self

Converts to this type from the input type.
source§

impl FromIterator<MappingFlags> for MappingFlags

source§

fn from_iter<T: IntoIterator<Item = Self>>(iterator: T) -> Self

The bitwise or (|) of the bits in each flags value.

+
source§

impl IntoIterator for MappingFlags

§

type Item = MappingFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<MappingFlags>

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 LowerHex for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Not for MappingFlags

source§

fn not(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = MappingFlags

The resulting type after applying the ! operator.
source§

impl Octal for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for MappingFlags

source§

fn eq(&self, other: &MappingFlags) -> 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 PublicFlags for MappingFlags

§

type Primitive = usize

The type of the underlying storage.
§

type Internal = InternalBitFlags

The type of the internal field on the generated flags type.
source§

impl Sub for MappingFlags

source§

fn sub(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = MappingFlags

The resulting type after applying the - operator.
source§

impl SubAssign for MappingFlags

source§

fn sub_assign(&mut self, other: Self)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
source§

impl UpperHex for MappingFlags

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Copy for MappingFlags

source§

impl StructuralPartialEq for MappingFlags

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_entry/trait.GenericPTE.html b/page_table_entry/trait.GenericPTE.html new file mode 100644 index 0000000..f27f07b --- /dev/null +++ b/page_table_entry/trait.GenericPTE.html @@ -0,0 +1,28 @@ +GenericPTE in page_table_entry - Rust

Trait page_table_entry::GenericPTE

source ·
pub trait GenericPTE: Debug + Clone + Copy + Sync + Send + Sized {
+    // Required methods
+    fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self;
+    fn new_table(paddr: PhysAddr) -> Self;
+    fn paddr(&self) -> PhysAddr;
+    fn flags(&self) -> MappingFlags;
+    fn set_paddr(&mut self, paddr: PhysAddr);
+    fn set_flags(&mut self, flags: MappingFlags, is_huge: bool);
+    fn bits(self) -> usize;
+    fn is_unused(&self) -> bool;
+    fn is_present(&self) -> bool;
+    fn is_huge(&self) -> bool;
+    fn clear(&mut self);
+}
Expand description

A generic page table entry.

+

All architecture-specific page table entry types implement this trait.

+

Required Methods§

source

fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self

Creates a page table entry point to a terminate page or block.

+
source

fn new_table(paddr: PhysAddr) -> Self

Creates a page table entry point to a next level page table.

+
source

fn paddr(&self) -> PhysAddr

Returns the physical address mapped by this entry.

+
source

fn flags(&self) -> MappingFlags

Returns the flags of this entry.

+
source

fn set_paddr(&mut self, paddr: PhysAddr)

Set mapped physical address of the entry.

+
source

fn set_flags(&mut self, flags: MappingFlags, is_huge: bool)

Set flags of the entry.

+
source

fn bits(self) -> usize

Returns the raw bits of this entry.

+
source

fn is_unused(&self) -> bool

Returns whether this entry is zero.

+
source

fn is_present(&self) -> bool

Returns whether this entry flag indicates present.

+
source

fn is_huge(&self) -> bool

For non-last level translation, returns whether this entry maps to a +huge frame.

+
source

fn clear(&mut self)

Set this entry to zero.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl GenericPTE for A64PTE

Available on AArch64 only.
source§

impl GenericPTE for Rv64PTE

Available on RISC-V RV32 or RISC-V RV64 only.
source§

impl GenericPTE for X64PTE

Available on x86-64 only.
\ No newline at end of file diff --git a/page_table_entry/x86_64/index.html b/page_table_entry/x86_64/index.html new file mode 100644 index 0000000..1a3e4bd --- /dev/null +++ b/page_table_entry/x86_64/index.html @@ -0,0 +1,2 @@ +page_table_entry::x86_64 - Rust

Module page_table_entry::x86_64

source ·
Available on x86-64 only.
Expand description

x86 page table entries on 64-bit paging.

+

Structs§

  • Possible flags for a page table entry.
  • An x86_64 page table entry.
\ No newline at end of file diff --git a/page_table_entry/x86_64/sidebar-items.js b/page_table_entry/x86_64/sidebar-items.js new file mode 100644 index 0000000..640799e --- /dev/null +++ b/page_table_entry/x86_64/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["PTF","X64PTE"]}; \ No newline at end of file diff --git a/page_table_entry/x86_64/struct.PTF.html b/page_table_entry/x86_64/struct.PTF.html new file mode 100644 index 0000000..6f8d61c --- /dev/null +++ b/page_table_entry/x86_64/struct.PTF.html @@ -0,0 +1,113 @@ +PTF in page_table_entry::x86_64 - Rust

Struct page_table_entry::x86_64::PTF

pub struct PTF(/* private fields */);
Available on x86-64 only.
Expand description

Possible flags for a page table entry.

+

Implementations§

§

impl PageTableFlags

pub const PRESENT: PageTableFlags = _

Specifies whether the mapped frame or page table is loaded in memory.

+

pub const WRITABLE: PageTableFlags = _

Controls whether writes to the mapped frames are allowed.

+

If this bit is unset in a level 1 page table entry, the mapped frame is read-only. +If this bit is unset in a higher level page table entry the complete range of mapped +pages is read-only.

+

pub const USER_ACCESSIBLE: PageTableFlags = _

Controls whether accesses from userspace (i.e. ring 3) are permitted.

+

pub const WRITE_THROUGH: PageTableFlags = _

If this bit is set, a “write-through” policy is used for the cache, else a “write-back” +policy is used.

+

pub const NO_CACHE: PageTableFlags = _

Disables caching for the pointed entry is cacheable.

+

pub const ACCESSED: PageTableFlags = _

Set by the CPU when the mapped frame or page table is accessed.

+

pub const DIRTY: PageTableFlags = _

Set by the CPU on a write to the mapped frame.

+

pub const HUGE_PAGE: PageTableFlags = _

Specifies that the entry maps a huge frame instead of a page table. Only allowed in +P2 or P3 tables.

+

pub const GLOBAL: PageTableFlags = _

Indicates that the mapping is present in all address spaces, so it isn’t flushed from +the TLB on an address space switch.

+

pub const BIT_9: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_10: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_11: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_52: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_53: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_54: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_55: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_56: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_57: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_58: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_59: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_60: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_61: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const BIT_62: PageTableFlags = _

Available to the OS, can be used to store additional data, e.g. custom flags.

+

pub const NO_EXECUTE: PageTableFlags = _

Forbid code execution from the mapped frames.

+

Can be only used when the no-execute page protection feature is enabled in the EFER +register.

+
§

impl PageTableFlags

pub const fn empty() -> PageTableFlags

Get a flags value with all bits unset.

+

pub const fn all() -> PageTableFlags

Get a flags value with all known bits set.

+

pub const fn bits(&self) -> u64

Get the underlying bits value.

+

The returned value is exactly the bits set in this flags value.

+

pub const fn from_bits(bits: u64) -> Option<PageTableFlags>

Convert from a bits value.

+

This method will return None if any unknown bits are set.

+

pub const fn from_bits_truncate(bits: u64) -> PageTableFlags

Convert from a bits value, unsetting any unknown bits.

+

pub const fn from_bits_retain(bits: u64) -> PageTableFlags

Convert from a bits value exactly.

+

pub fn from_name(name: &str) -> Option<PageTableFlags>

Get a flags value with the bits of a flag with the given name set.

+

This method will return None if name is empty or doesn’t +correspond to any named flag.

+

pub const fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.

+

pub const fn is_all(&self) -> bool

Whether all known bits in this flags value are set.

+

pub const fn intersects(&self, other: PageTableFlags) -> bool

Whether any set bits in a source flags value are also set in a target flags value.

+

pub const fn contains(&self, other: PageTableFlags) -> bool

Whether all set bits in a source flags value are also set in a target flags value.

+

pub fn insert(&mut self, other: PageTableFlags)

The bitwise or (|) of the bits in two flags values.

+

pub fn remove(&mut self, other: PageTableFlags)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +remove won’t truncate other, but the ! operator will.

+

pub fn toggle(&mut self, other: PageTableFlags)

The bitwise exclusive-or (^) of the bits in two flags values.

+

pub fn set(&mut self, other: PageTableFlags, value: bool)

Call insert when value is true or remove when value is false.

+

pub const fn intersection(self, other: PageTableFlags) -> PageTableFlags

The bitwise and (&) of the bits in two flags values.

+

pub const fn union(self, other: PageTableFlags) -> PageTableFlags

The bitwise or (|) of the bits in two flags values.

+

pub const fn difference(self, other: PageTableFlags) -> PageTableFlags

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+

pub const fn symmetric_difference(self, other: PageTableFlags) -> PageTableFlags

The bitwise exclusive-or (^) of the bits in two flags values.

+

pub const fn complement(self) -> PageTableFlags

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

impl PageTableFlags

pub const fn iter(&self) -> Iter<PageTableFlags>

Yield a set of contained flags values.

+

Each yielded flags value will correspond to a defined named flag. Any unknown bits +will be yielded together as a final flags value.

+

pub const fn iter_names(&self) -> IterNames<PageTableFlags>

Yield a set of contained named flags values.

+

This method is like iter, except only yields bits in contained named flags. +Any unknown bits, or bits not corresponding to a contained flag will not be yielded.

+

Trait Implementations§

§

impl Binary for PageTableFlags

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl BitAnd for PageTableFlags

§

fn bitand(self, other: PageTableFlags) -> PageTableFlags

The bitwise and (&) of the bits in two flags values.

+
§

type Output = PageTableFlags

The resulting type after applying the & operator.
§

impl BitAndAssign for PageTableFlags

§

fn bitand_assign(&mut self, other: PageTableFlags)

The bitwise and (&) of the bits in two flags values.

+
§

impl BitOr for PageTableFlags

§

fn bitor(self, other: PageTableFlags) -> PageTableFlags

The bitwise or (|) of the bits in two flags values.

+
§

type Output = PageTableFlags

The resulting type after applying the | operator.
§

impl BitOrAssign for PageTableFlags

§

fn bitor_assign(&mut self, other: PageTableFlags)

The bitwise or (|) of the bits in two flags values.

+
§

impl BitXor for PageTableFlags

§

fn bitxor(self, other: PageTableFlags) -> PageTableFlags

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

type Output = PageTableFlags

The resulting type after applying the ^ operator.
§

impl BitXorAssign for PageTableFlags

§

fn bitxor_assign(&mut self, other: PageTableFlags)

The bitwise exclusive-or (^) of the bits in two flags values.

+
§

impl Clone for PageTableFlags

§

fn clone(&self) -> PageTableFlags

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
§

impl Debug for PageTableFlags

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Extend<PageTableFlags> for PageTableFlags

§

fn extend<T>(&mut self, iterator: T)
where + T: IntoIterator<Item = PageTableFlags>,

The bitwise or (|) of the bits in each flags value.

+
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
§

impl Flags for PageTableFlags

§

const FLAGS: &'static [Flag<PageTableFlags>] = _

The set of defined flags.
§

type Bits = u64

The underlying bits type.
§

fn bits(&self) -> u64

Get the underlying bits value. Read more
§

fn from_bits_retain(bits: u64) -> PageTableFlags

Convert from a bits value exactly.
§

fn empty() -> Self

Get a flags value with all bits unset.
§

fn all() -> Self

Get a flags value with all known bits set.
§

fn from_bits(bits: Self::Bits) -> Option<Self>

Convert from a bits value. Read more
§

fn from_bits_truncate(bits: Self::Bits) -> Self

Convert from a bits value, unsetting any unknown bits.
§

fn from_name(name: &str) -> Option<Self>

Get a flags value with the bits of a flag with the given name set. Read more
§

fn iter(&self) -> Iter<Self>

Yield a set of contained flags values. Read more
§

fn iter_names(&self) -> IterNames<Self>

Yield a set of contained named flags values. Read more
§

fn is_empty(&self) -> bool

Whether all bits in this flags value are unset.
§

fn is_all(&self) -> bool

Whether all known bits in this flags value are set.
§

fn intersects(&self, other: Self) -> bool
where + Self: Sized,

Whether any set bits in a source flags value are also set in a target flags value.
§

fn contains(&self, other: Self) -> bool
where + Self: Sized,

Whether all set bits in a source flags value are also set in a target flags value.
§

fn insert(&mut self, other: Self)
where + Self: Sized,

The bitwise or (|) of the bits in two flags values.
§

fn remove(&mut self, other: Self)
where + Self: Sized,

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn toggle(&mut self, other: Self)
where + Self: Sized,

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn set(&mut self, other: Self, value: bool)
where + Self: Sized,

Call [Flags::insert] when value is true or [Flags::remove] when value is false.
§

fn intersection(self, other: Self) -> Self

The bitwise and (&) of the bits in two flags values.
§

fn union(self, other: Self) -> Self

The bitwise or (|) of the bits in two flags values.
§

fn difference(self, other: Self) -> Self

The intersection of a source flags value with the complement of a target flags value (&!). Read more
§

fn symmetric_difference(self, other: Self) -> Self

The bitwise exclusive-or (^) of the bits in two flags values.
§

fn complement(self) -> Self

The bitwise negation (!) of the bits in a flags value, truncating the result.
source§

impl From<MappingFlags> for PTF

source§

fn from(f: MappingFlags) -> Self

Converts to this type from the input type.
source§

impl From<PageTableFlags> for MappingFlags

source§

fn from(f: PTF) -> Self

Converts to this type from the input type.
§

impl FromIterator<PageTableFlags> for PageTableFlags

§

fn from_iter<T>(iterator: T) -> PageTableFlags
where + T: IntoIterator<Item = PageTableFlags>,

The bitwise or (|) of the bits in each flags value.

+
§

impl Hash for PageTableFlags

§

fn hash<__H>(&self, state: &mut __H)
where + __H: Hasher,

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
§

impl IntoIterator for PageTableFlags

§

type Item = PageTableFlags

The type of the elements being iterated over.
§

type IntoIter = Iter<PageTableFlags>

Which kind of iterator are we turning this into?
§

fn into_iter(self) -> <PageTableFlags as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
§

impl LowerHex for PageTableFlags

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Not for PageTableFlags

§

fn not(self) -> PageTableFlags

The bitwise negation (!) of the bits in a flags value, truncating the result.

+
§

type Output = PageTableFlags

The resulting type after applying the ! operator.
§

impl Octal for PageTableFlags

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for PageTableFlags

§

fn cmp(&self, other: &PageTableFlags) -> 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
§

impl PartialEq for PageTableFlags

§

fn eq(&self, other: &PageTableFlags) -> 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.
§

impl PartialOrd for PageTableFlags

§

fn partial_cmp(&self, other: &PageTableFlags) -> 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
§

impl Sub for PageTableFlags

§

fn sub(self, other: PageTableFlags) -> PageTableFlags

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

type Output = PageTableFlags

The resulting type after applying the - operator.
§

impl SubAssign for PageTableFlags

§

fn sub_assign(&mut self, other: PageTableFlags)

The intersection of a source flags value with the complement of a target flags value (&!).

+

This method is not equivalent to self & !other when other has unknown bits set. +difference won’t truncate other, but the ! operator will.

+
§

impl UpperHex for PageTableFlags

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Copy for PageTableFlags

§

impl Eq for PageTableFlags

§

impl StructuralPartialEq for PageTableFlags

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_entry/x86_64/struct.X64PTE.html b/page_table_entry/x86_64/struct.X64PTE.html new file mode 100644 index 0000000..d0f1fce --- /dev/null +++ b/page_table_entry/x86_64/struct.X64PTE.html @@ -0,0 +1,15 @@ +X64PTE in page_table_entry::x86_64 - Rust

Struct page_table_entry::x86_64::X64PTE

source ·
pub struct X64PTE(/* private fields */);
Available on x86-64 only.
Expand description

An x86_64 page table entry.

+

Trait Implementations§

source§

impl Clone for X64PTE

source§

fn clone(&self) -> X64PTE

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 X64PTE

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl GenericPTE for X64PTE

source§

fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self

Creates a page table entry point to a terminate page or block.
source§

fn new_table(paddr: PhysAddr) -> Self

Creates a page table entry point to a next level page table.
source§

fn paddr(&self) -> PhysAddr

Returns the physical address mapped by this entry.
source§

fn flags(&self) -> MappingFlags

Returns the flags of this entry.
source§

fn set_paddr(&mut self, paddr: PhysAddr)

Set mapped physical address of the entry.
source§

fn set_flags(&mut self, flags: MappingFlags, is_huge: bool)

Set flags of the entry.
source§

fn bits(self) -> usize

Returns the raw bits of this entry.
source§

fn is_unused(&self) -> bool

Returns whether this entry is zero.
source§

fn is_present(&self) -> bool

Returns whether this entry flag indicates present.
source§

fn is_huge(&self) -> bool

For non-last level translation, returns whether this entry maps to a +huge frame.
source§

fn clear(&mut self)

Set this entry to zero.
source§

impl Copy for X64PTE

Auto Trait Implementations§

§

impl Freeze for X64PTE

§

impl RefUnwindSafe for X64PTE

§

impl Send for X64PTE

§

impl Sync for X64PTE

§

impl Unpin for X64PTE

§

impl UnwindSafe for X64PTE

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_multiarch/aarch64/index.html b/page_table_multiarch/aarch64/index.html new file mode 100644 index 0000000..29c568c --- /dev/null +++ b/page_table_multiarch/aarch64/index.html @@ -0,0 +1,2 @@ +page_table_multiarch::aarch64 - Rust

Module page_table_multiarch::aarch64

source ·
Available on AArch64 only.
Expand description

AArch64 specific page table structures.

+

Structs§

Type Aliases§

\ No newline at end of file diff --git a/page_table_multiarch/aarch64/sidebar-items.js b/page_table_multiarch/aarch64/sidebar-items.js new file mode 100644 index 0000000..58260fd --- /dev/null +++ b/page_table_multiarch/aarch64/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["A64PagingMetaData"],"type":["A64PageTable"]}; \ No newline at end of file diff --git a/page_table_multiarch/aarch64/struct.A64PagingMetaData.html b/page_table_multiarch/aarch64/struct.A64PagingMetaData.html new file mode 100644 index 0000000..95598c5 --- /dev/null +++ b/page_table_multiarch/aarch64/struct.A64PagingMetaData.html @@ -0,0 +1,15 @@ +A64PagingMetaData in page_table_multiarch::aarch64 - Rust

Struct page_table_multiarch::aarch64::A64PagingMetaData

source ·
pub struct A64PagingMetaData;
Available on AArch64 only.
Expand description

Metadata of AArch64 page tables.

+

Trait Implementations§

source§

impl Clone for A64PagingMetaData

source§

fn clone(&self) -> A64PagingMetaData

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 PagingMetaData for A64PagingMetaData

source§

const LEVELS: usize = 4usize

The number of levels of the hardware page table.
source§

const PA_MAX_BITS: usize = 48usize

The maximum number of bits of physical address.
source§

const VA_MAX_BITS: usize = 48usize

The maximum number of bits of virtual address.
source§

fn vaddr_is_valid(vaddr: usize) -> bool

Whether a given virtual address is valid.
source§

const PA_MAX_ADDR: usize = _

The maximum physical address.
source§

fn paddr_is_valid(paddr: usize) -> bool

Whether a given physical address is valid.
source§

impl Copy for A64PagingMetaData

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_multiarch/aarch64/type.A64PageTable.html b/page_table_multiarch/aarch64/type.A64PageTable.html new file mode 100644 index 0000000..1daa3b0 --- /dev/null +++ b/page_table_multiarch/aarch64/type.A64PageTable.html @@ -0,0 +1,2 @@ +A64PageTable in page_table_multiarch::aarch64 - Rust

Type Alias page_table_multiarch::aarch64::A64PageTable

source ·
pub type A64PageTable<H> = PageTable64<A64PagingMetaData, A64PTE, H>;
Available on AArch64 only.
Expand description

AArch64 VMSAv8-64 translation table.

+

Aliased Type§

struct A64PageTable<H> { /* private fields */ }
\ No newline at end of file diff --git a/page_table_multiarch/all.html b/page_table_multiarch/all.html new file mode 100644 index 0000000..82c6da7 --- /dev/null +++ b/page_table_multiarch/all.html @@ -0,0 +1 @@ +List of all items in this crate

List of all items

Structs

Enums

Traits

Type Aliases

\ No newline at end of file diff --git a/page_table_multiarch/arch/aarch64/index.html b/page_table_multiarch/arch/aarch64/index.html new file mode 100644 index 0000000..c80ee70 --- /dev/null +++ b/page_table_multiarch/arch/aarch64/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/aarch64/index.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/aarch64/struct.A64PagingMetaData.html b/page_table_multiarch/arch/aarch64/struct.A64PagingMetaData.html new file mode 100644 index 0000000..5760688 --- /dev/null +++ b/page_table_multiarch/arch/aarch64/struct.A64PagingMetaData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/aarch64/struct.A64PagingMetaData.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/aarch64/type.A64PageTable.html b/page_table_multiarch/arch/aarch64/type.A64PageTable.html new file mode 100644 index 0000000..a09a199 --- /dev/null +++ b/page_table_multiarch/arch/aarch64/type.A64PageTable.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/aarch64/type.A64PageTable.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/riscv/index.html b/page_table_multiarch/arch/riscv/index.html new file mode 100644 index 0000000..f1f73ba --- /dev/null +++ b/page_table_multiarch/arch/riscv/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/riscv/index.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/riscv/struct.Sv39MetaData.html b/page_table_multiarch/arch/riscv/struct.Sv39MetaData.html new file mode 100644 index 0000000..2730d1c --- /dev/null +++ b/page_table_multiarch/arch/riscv/struct.Sv39MetaData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/riscv/struct.Sv39MetaData.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/riscv/struct.Sv48MetaData.html b/page_table_multiarch/arch/riscv/struct.Sv48MetaData.html new file mode 100644 index 0000000..3a3f8eb --- /dev/null +++ b/page_table_multiarch/arch/riscv/struct.Sv48MetaData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/riscv/struct.Sv48MetaData.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/riscv/type.Sv39PageTable.html b/page_table_multiarch/arch/riscv/type.Sv39PageTable.html new file mode 100644 index 0000000..31f6a2b --- /dev/null +++ b/page_table_multiarch/arch/riscv/type.Sv39PageTable.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/riscv/type.Sv39PageTable.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/riscv/type.Sv48PageTable.html b/page_table_multiarch/arch/riscv/type.Sv48PageTable.html new file mode 100644 index 0000000..722185c --- /dev/null +++ b/page_table_multiarch/arch/riscv/type.Sv48PageTable.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/riscv/type.Sv48PageTable.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/x86_64/index.html b/page_table_multiarch/arch/x86_64/index.html new file mode 100644 index 0000000..f42670e --- /dev/null +++ b/page_table_multiarch/arch/x86_64/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/x86_64/index.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/x86_64/struct.X64PagingMetaData.html b/page_table_multiarch/arch/x86_64/struct.X64PagingMetaData.html new file mode 100644 index 0000000..e9bdaf1 --- /dev/null +++ b/page_table_multiarch/arch/x86_64/struct.X64PagingMetaData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/x86_64/struct.X64PagingMetaData.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/arch/x86_64/type.X64PageTable.html b/page_table_multiarch/arch/x86_64/type.X64PageTable.html new file mode 100644 index 0000000..881df52 --- /dev/null +++ b/page_table_multiarch/arch/x86_64/type.X64PageTable.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../page_table_multiarch/x86_64/type.X64PageTable.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/bits64/struct.PageTable64.html b/page_table_multiarch/bits64/struct.PageTable64.html new file mode 100644 index 0000000..c61d919 --- /dev/null +++ b/page_table_multiarch/bits64/struct.PageTable64.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../page_table_multiarch/struct.PageTable64.html...

+ + + \ No newline at end of file diff --git a/page_table_multiarch/enum.PageSize.html b/page_table_multiarch/enum.PageSize.html new file mode 100644 index 0000000..901b7e6 --- /dev/null +++ b/page_table_multiarch/enum.PageSize.html @@ -0,0 +1,25 @@ +PageSize in page_table_multiarch - Rust

Enum page_table_multiarch::PageSize

source ·
#[repr(usize)]
pub enum PageSize { + Size4K = 4_096, + Size2M = 2_097_152, + Size1G = 1_073_741_824, +}
Expand description

The page sizes supported by the hardware page table.

+

Variants§

§

Size4K = 4_096

Size of 4 kilobytes (212 bytes).

+
§

Size2M = 2_097_152

Size of 2 megabytes (221 bytes).

+
§

Size1G = 1_073_741_824

Size of 1 gigabytes (230 bytes).

+

Implementations§

source§

impl PageSize

source

pub const fn is_huge(self) -> bool

Whether this page size is considered huge (larger than 4K).

+

Trait Implementations§

source§

impl Clone for PageSize

source§

fn clone(&self) -> PageSize

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 PageSize

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<PageSize> for usize

source§

fn from(size: PageSize) -> usize

Converts to this type from the input type.
source§

impl PartialEq for PageSize

source§

fn eq(&self, other: &PageSize) -> 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 PageSize

source§

impl Eq for PageSize

source§

impl StructuralPartialEq for PageSize

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_multiarch/enum.PagingError.html b/page_table_multiarch/enum.PagingError.html new file mode 100644 index 0000000..940a68c --- /dev/null +++ b/page_table_multiarch/enum.PagingError.html @@ -0,0 +1,26 @@ +PagingError in page_table_multiarch - Rust

Enum page_table_multiarch::PagingError

source ·
pub enum PagingError {
+    NoMemory,
+    NotAligned,
+    NotMapped,
+    AlreadyMapped,
+    MappedToHugePage,
+}
Expand description

The error type for page table operation failures.

+

Variants§

§

NoMemory

Cannot allocate memory.

+
§

NotAligned

The address is not aligned to the page size.

+
§

NotMapped

The mapping is not present.

+
§

AlreadyMapped

The mapping is already present.

+
§

MappedToHugePage

The page table entry represents a huge page, but the target physical +frame is 4K in size.

+

Trait Implementations§

source§

impl Debug for PagingError

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq for PagingError

source§

fn eq(&self, other: &PagingError) -> 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 StructuralPartialEq for PagingError

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).

+

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 diff --git a/page_table_multiarch/index.html b/page_table_multiarch/index.html new file mode 100644 index 0000000..cf05f1c --- /dev/null +++ b/page_table_multiarch/index.html @@ -0,0 +1,55 @@ +page_table_multiarch - Rust

Crate page_table_multiarch

source ·
Expand description

§page_table_multiarch

+

Crates.io

+

This crate provides generic, unified, architecture-independent, and OS-free page table structures for various hardware architectures.

+

The core struct is PageTable64<M, PTE, H>. OS-functions and architecture-dependent types are provided by generic parameters:

+
    +
  • M: The architecture-dependent metadata, requires to implement the PagingMetaData trait.
  • +
  • PTE: The architecture-dependent page table entry, requires to implement the GenericPTE trait.
  • +
  • H: OS-functions such as physical memory allocation, requires to implement the PagingHandler trait.
  • +
+

Currently supported architectures and page table structures:

+ +

§Examples (x86_64)

+
use memory_addr::{PhysAddr, VirtAddr};
+use page_table_multiarch::x86_64::{X64PageTable};
+use page_table_multiarch::{MappingFlags, PagingHandler, PageSize};
+
+use core::alloc::Layout;
+
+extern crate alloc;
+
+struct PagingHandlerImpl;
+
+impl PagingHandler for PagingHandlerImpl {
+    fn alloc_frame() -> Option<PhysAddr> {
+        let layout = Layout::from_size_align(0x1000, 0x1000).unwrap();
+        let ptr = unsafe { alloc::alloc::alloc(layout) };
+        Some(PhysAddr::from(ptr as usize))
+    }
+
+    fn dealloc_frame(paddr: PhysAddr) {
+        let layout = Layout::from_size_align(0x1000, 0x1000).unwrap();
+        let ptr = paddr.as_usize() as *mut u8;
+        unsafe { alloc::alloc::dealloc(ptr, layout) };
+    }
+
+    fn phys_to_virt(paddr: PhysAddr) -> VirtAddr {
+        VirtAddr::from(paddr.as_usize())
+    }
+}
+
+let vaddr = VirtAddr::from(0xdead_beef_000);
+let paddr = PhysAddr::from(0x2000);
+let flags = MappingFlags::READ | MappingFlags::WRITE;
+let mut pt = X64PageTable::<PagingHandlerImpl>::try_new().unwrap();
+
+assert!(pt.root_paddr().is_aligned_4k());
+assert!(pt.map(vaddr, paddr, PageSize::Size4K, flags).is_ok());
+assert_eq!(pt.query(vaddr), Ok((paddr, flags, PageSize::Size4K)));
+

Re-exports§

Modules§

  • aarch64AArch64
    AArch64 specific page table structures.
  • riscvRISC-V RV32 or RISC-V RV64
    RISC-V specific page table structures.
  • x86_64x86-64
    x86 specific page table structures.

Structs§

  • A generic page table struct for 64-bit platform.

Enums§

  • The page sizes supported by the hardware page table.
  • The error type for page table operation failures.

Traits§

Type Aliases§

  • The specialized Result type for page table operations.
\ No newline at end of file diff --git a/page_table_multiarch/riscv/index.html b/page_table_multiarch/riscv/index.html new file mode 100644 index 0000000..75fef31 --- /dev/null +++ b/page_table_multiarch/riscv/index.html @@ -0,0 +1,2 @@ +page_table_multiarch::riscv - Rust

Module page_table_multiarch::riscv

source ·
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

RISC-V specific page table structures.

+

Structs§

Type Aliases§

  • Sv39: Page-Based 39-bit (3 levels) Virtual-Memory System.
  • Sv48: Page-Based 48-bit (4 levels) Virtual-Memory System.
\ No newline at end of file diff --git a/page_table_multiarch/riscv/sidebar-items.js b/page_table_multiarch/riscv/sidebar-items.js new file mode 100644 index 0000000..85cb871 --- /dev/null +++ b/page_table_multiarch/riscv/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["Sv39MetaData","Sv48MetaData"],"type":["Sv39PageTable","Sv48PageTable"]}; \ No newline at end of file diff --git a/page_table_multiarch/riscv/struct.Sv39MetaData.html b/page_table_multiarch/riscv/struct.Sv39MetaData.html new file mode 100644 index 0000000..5bf668d --- /dev/null +++ b/page_table_multiarch/riscv/struct.Sv39MetaData.html @@ -0,0 +1,15 @@ +Sv39MetaData in page_table_multiarch::riscv - Rust

Struct page_table_multiarch::riscv::Sv39MetaData

source ·
pub struct Sv39MetaData;
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

Metadata of RISC-V Sv39 page tables.

+

Trait Implementations§

source§

impl Clone for Sv39MetaData

source§

fn clone(&self) -> Sv39MetaData

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 PagingMetaData for Sv39MetaData

source§

const LEVELS: usize = 3usize

The number of levels of the hardware page table.
source§

const PA_MAX_BITS: usize = 56usize

The maximum number of bits of physical address.
source§

const VA_MAX_BITS: usize = 39usize

The maximum number of bits of virtual address.
source§

const PA_MAX_ADDR: usize = _

The maximum physical address.
source§

fn paddr_is_valid(paddr: usize) -> bool

Whether a given physical address is valid.
source§

fn vaddr_is_valid(vaddr: usize) -> bool

Whether a given virtual address is valid.
source§

impl Copy for Sv39MetaData

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_multiarch/riscv/struct.Sv48MetaData.html b/page_table_multiarch/riscv/struct.Sv48MetaData.html new file mode 100644 index 0000000..8023ef4 --- /dev/null +++ b/page_table_multiarch/riscv/struct.Sv48MetaData.html @@ -0,0 +1,15 @@ +Sv48MetaData in page_table_multiarch::riscv - Rust

Struct page_table_multiarch::riscv::Sv48MetaData

source ·
pub struct Sv48MetaData;
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

Metadata of RISC-V Sv48 page tables.

+

Trait Implementations§

source§

impl Clone for Sv48MetaData

source§

fn clone(&self) -> Sv48MetaData

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 PagingMetaData for Sv48MetaData

source§

const LEVELS: usize = 4usize

The number of levels of the hardware page table.
source§

const PA_MAX_BITS: usize = 56usize

The maximum number of bits of physical address.
source§

const VA_MAX_BITS: usize = 48usize

The maximum number of bits of virtual address.
source§

const PA_MAX_ADDR: usize = _

The maximum physical address.
source§

fn paddr_is_valid(paddr: usize) -> bool

Whether a given physical address is valid.
source§

fn vaddr_is_valid(vaddr: usize) -> bool

Whether a given virtual address is valid.
source§

impl Copy for Sv48MetaData

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> CloneToUninit for T
where + T: Clone,

source§

default unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> CloneToUninit for T
where + T: Copy,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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 diff --git a/page_table_multiarch/riscv/type.Sv39PageTable.html b/page_table_multiarch/riscv/type.Sv39PageTable.html new file mode 100644 index 0000000..627cdf4 --- /dev/null +++ b/page_table_multiarch/riscv/type.Sv39PageTable.html @@ -0,0 +1,2 @@ +Sv39PageTable in page_table_multiarch::riscv - Rust

Type Alias page_table_multiarch::riscv::Sv39PageTable

source ·
pub type Sv39PageTable<H> = PageTable64<Sv39MetaData, Rv64PTE, H>;
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

Sv39: Page-Based 39-bit (3 levels) Virtual-Memory System.

+

Aliased Type§

struct Sv39PageTable<H> { /* private fields */ }
\ No newline at end of file diff --git a/page_table_multiarch/riscv/type.Sv48PageTable.html b/page_table_multiarch/riscv/type.Sv48PageTable.html new file mode 100644 index 0000000..85cf508 --- /dev/null +++ b/page_table_multiarch/riscv/type.Sv48PageTable.html @@ -0,0 +1,2 @@ +Sv48PageTable in page_table_multiarch::riscv - Rust

Type Alias page_table_multiarch::riscv::Sv48PageTable

source ·
pub type Sv48PageTable<H> = PageTable64<Sv48MetaData, Rv64PTE, H>;
Available on RISC-V RV32 or RISC-V RV64 only.
Expand description

Sv48: Page-Based 48-bit (4 levels) Virtual-Memory System.

+

Aliased Type§

struct Sv48PageTable<H> { /* private fields */ }
\ No newline at end of file diff --git a/page_table_multiarch/sidebar-items.js b/page_table_multiarch/sidebar-items.js new file mode 100644 index 0000000..f661b17 --- /dev/null +++ b/page_table_multiarch/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["PageSize","PagingError"],"mod":["aarch64","riscv","x86_64"],"struct":["PageTable64"],"trait":["PagingHandler","PagingMetaData"],"type":["PagingResult"]}; \ No newline at end of file diff --git a/page_table_multiarch/struct.PageTable64.html b/page_table_multiarch/struct.PageTable64.html new file mode 100644 index 0000000..f65da64 --- /dev/null +++ b/page_table_multiarch/struct.PageTable64.html @@ -0,0 +1,90 @@ +PageTable64 in page_table_multiarch - Rust

Struct page_table_multiarch::PageTable64

source ·
pub struct PageTable64<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> { /* private fields */ }
Expand description

A generic page table struct for 64-bit platform.

+

It also tracks all intermediate level tables. They will be deallocated +When the PageTable64 itself is dropped.

+

Implementations§

source§

impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> PageTable64<M, PTE, H>

source

pub fn try_new() -> PagingResult<Self>

Creates a new page table instance or returns the error.

+

It will allocate a new page for the root page table.

+
source

pub const fn root_paddr(&self) -> PhysAddr

Returns the physical address of the root page table.

+
source

pub fn map( + &mut self, + vaddr: VirtAddr, + target: PhysAddr, + page_size: PageSize, + flags: MappingFlags, +) -> PagingResult

Maps a virtual page to a physical frame with the given page_size +and mapping flags.

+

The virtual page starts with vaddr, amd the physical frame starts with +target. If the addresses is not aligned to the page size, they will be +aligned down automatically.

+

Returns Err(PagingError::AlreadyMapped) +if the mapping is already present.

+
source

pub fn unmap(&mut self, vaddr: VirtAddr) -> PagingResult<(PhysAddr, PageSize)>

Unmaps the mapping starts with vaddr.

+

Returns Err(PagingError::NotMapped) if the +mapping is not present.

+
source

pub fn query( + &self, + vaddr: VirtAddr, +) -> PagingResult<(PhysAddr, MappingFlags, PageSize)>

Query the result of the mapping starts with vaddr.

+

Returns the physical address of the target frame, mapping flags, and +the page size.

+

Returns Err(PagingError::NotMapped) if the +mapping is not present.

+
source

pub fn update( + &mut self, + vaddr: VirtAddr, + paddr: Option<PhysAddr>, + flags: Option<MappingFlags>, +) -> PagingResult<PageSize>

Updates the target or flags of the mapping starts with vaddr. If the +corresponding argument is None, it will not be updated.

+

Returns the page size of the mapping.

+

Returns Err(PagingError::NotMapped) if the +mapping is not present.

+
source

pub fn map_region( + &mut self, + vaddr: VirtAddr, + paddr: PhysAddr, + size: usize, + flags: MappingFlags, + allow_huge: bool, +) -> PagingResult

Map a contiguous virtual memory region to a contiguous physical memory +region with the given mapping flags.

+

The virtual and physical memory regions start with vaddr and paddr +respectively. The region size is size. The addresses and size must +be aligned to 4K, otherwise it will return Err(PagingError::NotAligned).

+

When allow_huge is true, it will try to map the region with huge pages +if possible. Otherwise, it will map the region with 4K pages.

+
source

pub fn unmap_region(&mut self, vaddr: VirtAddr, size: usize) -> PagingResult

Unmap a contiguous virtual memory region.

+

The region must be mapped before using PageTable64::map_region, or +unexpected behaviors may occur.

+
source

pub fn walk<F>(&self, limit: usize, func: &F) -> PagingResult
where + F: Fn(usize, usize, VirtAddr, &PTE),

Walk the page table recursively.

+

When reaching the leaf page table, call func on the current page table +entry. The max number of enumerations in one table is limited by limit.

+

The arguments of func are:

+
    +
  • Current level (starts with 0): usize
  • +
  • The index of the entry in the current-level table: usize
  • +
  • The virtual address that is mapped to the entry: [VirtAddr]
  • +
  • The reference of the entry: &PTE
  • +
+

Trait Implementations§

source§

impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> Drop for PageTable64<M, PTE, H>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<M, PTE, H> Freeze for PageTable64<M, PTE, H>

§

impl<M, PTE, H> RefUnwindSafe for PageTable64<M, PTE, H>
where + M: RefUnwindSafe, + PTE: RefUnwindSafe, + H: RefUnwindSafe,

§

impl<M, PTE, H> Send for PageTable64<M, PTE, H>
where + H: Send,

§

impl<M, PTE, H> Sync for PageTable64<M, PTE, H>
where + H: Sync,

§

impl<M, PTE, H> Unpin for PageTable64<M, PTE, H>
where + M: Unpin, + PTE: Unpin, + H: Unpin,

§

impl<M, PTE, H> UnwindSafe for PageTable64<M, PTE, H>
where + M: UnwindSafe, + PTE: UnwindSafe, + H: 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).

+

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 diff --git a/page_table_multiarch/trait.PagingHandler.html b/page_table_multiarch/trait.PagingHandler.html new file mode 100644 index 0000000..1281e29 --- /dev/null +++ b/page_table_multiarch/trait.PagingHandler.html @@ -0,0 +1,12 @@ +PagingHandler in page_table_multiarch - Rust

Trait page_table_multiarch::PagingHandler

source ·
pub trait PagingHandler: Sized {
+    // Required methods
+    fn alloc_frame() -> Option<PhysAddr>;
+    fn dealloc_frame(paddr: PhysAddr);
+    fn phys_to_virt(paddr: PhysAddr) -> VirtAddr;
+}
Expand description

The low-level OS-dependent helpers that must be provided for +PageTable64.

+

Required Methods§

source

fn alloc_frame() -> Option<PhysAddr>

Request to allocate a 4K-sized physical frame.

+
source

fn dealloc_frame(paddr: PhysAddr)

Request to free a allocated physical frame.

+
source

fn phys_to_virt(paddr: PhysAddr) -> VirtAddr

Returns a virtual address that maps to the given physical address.

+

Used to access the physical memory directly in page table implementation.

+

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/page_table_multiarch/trait.PagingMetaData.html b/page_table_multiarch/trait.PagingMetaData.html new file mode 100644 index 0000000..2d462c1 --- /dev/null +++ b/page_table_multiarch/trait.PagingMetaData.html @@ -0,0 +1,18 @@ +PagingMetaData in page_table_multiarch - Rust

Trait page_table_multiarch::PagingMetaData

source ·
pub trait PagingMetaData: Sync + Send + Sized {
+    const LEVELS: usize;
+    const PA_MAX_BITS: usize;
+    const VA_MAX_BITS: usize;
+    const PA_MAX_ADDR: usize = _;
+
+    // Provided methods
+    fn paddr_is_valid(paddr: usize) -> bool { ... }
+    fn vaddr_is_valid(vaddr: usize) -> bool { ... }
+}
Expand description

The architecture-dependent metadata that must be provided for +PageTable64.

+

Required Associated Constants§

source

const LEVELS: usize

The number of levels of the hardware page table.

+
source

const PA_MAX_BITS: usize

The maximum number of bits of physical address.

+
source

const VA_MAX_BITS: usize

The maximum number of bits of virtual address.

+

Provided Associated Constants§

source

const PA_MAX_ADDR: usize = _

The maximum physical address.

+

Provided Methods§

source

fn paddr_is_valid(paddr: usize) -> bool

Whether a given physical address is valid.

+
source

fn vaddr_is_valid(vaddr: usize) -> bool

Whether a given virtual address is valid.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl PagingMetaData for A64PagingMetaData

Available on AArch64 only.
source§

const LEVELS: usize = 4usize

source§

const PA_MAX_BITS: usize = 48usize

source§

const VA_MAX_BITS: usize = 48usize

source§

impl PagingMetaData for Sv39MetaData

Available on RISC-V RV32 or RISC-V RV64 only.
source§

const LEVELS: usize = 3usize

source§

const PA_MAX_BITS: usize = 56usize

source§

const VA_MAX_BITS: usize = 39usize

source§

impl PagingMetaData for Sv48MetaData

Available on RISC-V RV32 or RISC-V RV64 only.
source§

const LEVELS: usize = 4usize

source§

const PA_MAX_BITS: usize = 56usize

source§

const VA_MAX_BITS: usize = 48usize

source§

impl PagingMetaData for X64PagingMetaData

Available on x86-64 only.
source§

const LEVELS: usize = 4usize

source§

const PA_MAX_BITS: usize = 52usize

source§

const VA_MAX_BITS: usize = 48usize

\ No newline at end of file diff --git a/page_table_multiarch/type.PagingResult.html b/page_table_multiarch/type.PagingResult.html new file mode 100644 index 0000000..741c125 --- /dev/null +++ b/page_table_multiarch/type.PagingResult.html @@ -0,0 +1,7 @@ +PagingResult in page_table_multiarch - Rust

Type Alias page_table_multiarch::PagingResult

source ·
pub type PagingResult<T = ()> = Result<T, PagingError>;
Expand description

The specialized Result type for page table operations.

+

Aliased Type§

enum PagingResult<T = ()> {
+    Ok(T),
+    Err(PagingError),
+}

Variants§

§1.0.0

Ok(T)

Contains the success value

+
§1.0.0

Err(PagingError)

Contains the error value

+
\ No newline at end of file diff --git a/page_table_multiarch/x86_64/index.html b/page_table_multiarch/x86_64/index.html new file mode 100644 index 0000000..f6a246a --- /dev/null +++ b/page_table_multiarch/x86_64/index.html @@ -0,0 +1,2 @@ +page_table_multiarch::x86_64 - Rust

Module page_table_multiarch::x86_64

source ·
Available on x86-64 only.
Expand description

x86 specific page table structures.

+

Structs§

Type Aliases§

\ No newline at end of file diff --git a/page_table_multiarch/x86_64/sidebar-items.js b/page_table_multiarch/x86_64/sidebar-items.js new file mode 100644 index 0000000..c4c5475 --- /dev/null +++ b/page_table_multiarch/x86_64/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["X64PagingMetaData"],"type":["X64PageTable"]}; \ No newline at end of file diff --git a/page_table_multiarch/x86_64/struct.X64PagingMetaData.html b/page_table_multiarch/x86_64/struct.X64PagingMetaData.html new file mode 100644 index 0000000..4d11060 --- /dev/null +++ b/page_table_multiarch/x86_64/struct.X64PagingMetaData.html @@ -0,0 +1,12 @@ +X64PagingMetaData in page_table_multiarch::x86_64 - Rust

Struct page_table_multiarch::x86_64::X64PagingMetaData

source ·
pub struct X64PagingMetaData;
Available on x86-64 only.
Expand description

metadata of x86_64 page tables.

+

Trait Implementations§

source§

impl PagingMetaData for X64PagingMetaData

source§

const LEVELS: usize = 4usize

The number of levels of the hardware page table.
source§

const PA_MAX_BITS: usize = 52usize

The maximum number of bits of physical address.
source§

const VA_MAX_BITS: usize = 48usize

The maximum number of bits of virtual address.
source§

const PA_MAX_ADDR: usize = _

The maximum physical address.
source§

fn paddr_is_valid(paddr: usize) -> bool

Whether a given physical address is valid.
source§

fn vaddr_is_valid(vaddr: usize) -> bool

Whether a given virtual address is valid.

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).

+

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 diff --git a/page_table_multiarch/x86_64/type.X64PageTable.html b/page_table_multiarch/x86_64/type.X64PageTable.html new file mode 100644 index 0000000..3a10f56 --- /dev/null +++ b/page_table_multiarch/x86_64/type.X64PageTable.html @@ -0,0 +1,2 @@ +X64PageTable in page_table_multiarch::x86_64 - Rust

Type Alias page_table_multiarch::x86_64::X64PageTable

source ·
pub type X64PageTable<H> = PageTable64<X64PagingMetaData, X64PTE, H>;
Available on x86-64 only.
Expand description

x86_64 page table.

+

Aliased Type§

struct X64PageTable<H> { /* private fields */ }
\ No newline at end of file diff --git a/search-index.js b/search-index.js new file mode 100644 index 0000000..60408aa --- /dev/null +++ b/search-index.js @@ -0,0 +1,6 @@ +var searchIndex = new Map(JSON.parse('[\ +["page_table_entry",{"t":"TTKFTTTTCNNNNNMNNNNNNMNNNNNNNNNMNNNNNNNNNNNNNNNNNNNNNNMMMNNMMNMNCNMMNNNNNNNNCFTTTTTTTFPTTGTTTTPPTTTTTTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNTTTFTFTTTTNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNTTTTTTTTTTTTTTTTTTTTTFTTTFNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN","n":["DEVICE","EXECUTE","GenericPTE","MappingFlags","READ","UNCACHED","USER","WRITE","aarch64","all","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow_mut","clear","clone","clone_to_uninit","clone_to_uninit","complement","contains","difference","empty","eq","extend","flags","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from_bits","from_bits_retain","from_bits_retain","from_bits_truncate","from_iter","from_name","insert","intersection","intersects","into","into_iter","is_all","is_empty","is_huge","is_present","is_unused","iter","iter_names","new_page","new_table","not","paddr","remove","riscv","set","set_flags","set_paddr","sub","sub_assign","symmetric_difference","toggle","try_from","try_into","type_id","union","x86_64","A64PTE","AF","AP_EL0","AP_NO_EL0_TABLE","AP_NO_WRITE_TABLE","AP_RO","ATTR_INDX","CONTIGUOUS","DescriptorAttr","Device","INNER","MAIR_VALUE","MemAttr","NG","NON_BLOCK","NS","NS_TABLE","Normal","NormalNonCacheable","PXN","PXN_TABLE","SHAREABLE","UXN","VALID","XN_TABLE","all","all","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clear","clone","clone","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","complement","complement","contains","contains","difference","difference","empty","empty","empty","eq","extend","flags","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from_bits","from_bits","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_truncate","from_bits_truncate","from_iter","from_mem_attr","from_name","from_name","insert","insert","intersection","intersection","intersects","intersects","into","into","into","into_iter","is_all","is_all","is_empty","is_empty","is_huge","is_present","is_unused","iter","iter","iter_names","iter_names","mem_attr","new_page","new_table","not","paddr","remove","remove","set","set","set_flags","set_paddr","sub","sub_assign","symmetric_difference","symmetric_difference","toggle","toggle","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","union","union","A","D","G","PTEFlags","R","Rv64PTE","U","V","W","X","all","all","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow_mut","borrow_mut","clear","clone","clone_to_uninit","clone_to_uninit","complement","complement","contains","contains","difference","difference","empty","empty","extend","flags","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from_bits","from_bits","from_bits_retain","from_bits_retain","from_bits_retain","from_bits_truncate","from_bits_truncate","from_iter","from_name","from_name","insert","insert","intersection","intersection","intersects","intersects","into","into","into_iter","is_all","is_all","is_empty","is_empty","is_huge","is_present","is_unused","iter","iter","iter_names","iter_names","new_page","new_table","not","paddr","remove","remove","set","set","set_flags","set_paddr","sub","sub_assign","symmetric_difference","symmetric_difference","toggle","toggle","try_from","try_from","try_into","try_into","type_id","type_id","union","union","ACCESSED","BIT_10","BIT_11","BIT_52","BIT_53","BIT_54","BIT_55","BIT_56","BIT_57","BIT_58","BIT_59","BIT_60","BIT_61","BIT_62","BIT_9","DIRTY","GLOBAL","HUGE_PAGE","NO_CACHE","NO_EXECUTE","PRESENT","PTF","USER_ACCESSIBLE","WRITABLE","WRITE_THROUGH","X64PTE","all","bitand","bitand_assign","bitor","bitor_assign","bits","bits","bits","bitxor","bitxor_assign","borrow","borrow","borrow_mut","borrow_mut","clear","clone","clone","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","cmp","complement","contains","difference","empty","eq","extend","flags","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from_bits","from_bits_retain","from_bits_retain","from_bits_truncate","from_iter","from_name","hash","insert","intersection","intersects","into","into","into_iter","is_all","is_empty","is_huge","is_present","is_unused","iter","iter_names","new_page","new_table","not","paddr","partial_cmp","remove","set","set_flags","set_paddr","sub","sub_assign","symmetric_difference","toggle","try_from","try_from","try_into","try_into","type_id","type_id","union"],"q":[[0,"page_table_entry"],[77,"page_table_entry::aarch64"],[210,"page_table_entry::riscv"],[313,"page_table_entry::x86_64"],[417,"core::iter::traits::collect"],[418,"core::fmt"],[419,"page_table_entry::arch::riscv"],[420,"page_table_entry::arch::aarch64"],[421,"core::option"],[422,"bitflags::iter"],[423,"memory_addr::addr"],[424,"core::result"],[425,"core::any"],[426,"page_table_entry::arch::x86_64"],[427,"core::cmp"],[428,"core::hash"],[429,"page_table_entry::arch"]],"i":[1,1,0,0,1,1,1,1,0,1,1,1,1,1,5,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,5,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,5,5,5,1,1,5,5,1,5,1,0,1,5,5,1,1,1,1,1,1,1,1,0,0,13,13,13,13,13,13,13,0,24,13,24,0,13,13,13,13,24,24,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,23,13,13,13,24,23,13,24,23,23,24,23,24,24,23,23,13,13,13,13,13,13,13,13,23,24,13,23,13,13,13,13,13,24,23,13,13,24,23,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,13,24,23,13,13,13,13,13,23,23,23,13,13,13,13,13,23,23,13,23,13,13,13,13,23,23,13,13,13,13,13,13,13,24,23,13,24,23,13,24,23,13,13,12,12,12,0,12,0,12,12,12,12,12,12,12,12,12,12,12,12,12,25,12,12,12,25,12,25,25,25,25,25,12,12,12,12,12,12,12,12,12,25,12,12,12,12,12,25,12,12,25,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,12,25,12,12,12,12,12,25,25,25,12,12,12,12,25,25,12,25,12,12,12,12,25,25,12,12,12,12,12,12,12,25,12,25,12,25,12,12,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,0,14,14,14,0,14,14,14,14,14,26,14,14,14,14,26,14,26,14,26,26,14,26,26,14,14,14,14,14,14,14,14,14,26,26,14,14,14,14,14,26,14,14,14,14,14,14,14,14,14,14,14,14,26,14,14,14,14,26,26,26,14,14,26,26,14,26,14,14,14,26,26,14,14,14,14,26,14,26,14,26,14,14],"f":"`````````{{}b}{{bb}b}{{{f{db}}b}h}10{jl}{{{f{b}}}l}032{{{f{c}}}{{f{e}}}{}{}}{{{f{dc}}}{{f{de}}}{}{}}{{{f{dj}}}h}{{{f{b}}}b}{{{f{c}}}h{}}0{bb}{{{f{b}}b}n}:;{{{f{b}}{f{b}}}n}{{{f{db}}c}h{{Ab{}{{A`{b}}}}}}{{{f{j}}}b}{{{f{b}}{f{dAd}}}Af}0000{Ahb}{Ajb}{cc{}}{Alb}{l{{An{b}}}}{lb}00{cb{{Ab{}{{A`{b}}}}}}{{{f{B`}}}{{An{b}}}}{{{f{db}}b}h}{{bb}b}>{ce{}{}}{bc{}}{{{f{b}}}n}0{{{f{j}}}n}00{{{f{b}}}{{Bb{b}}}}{{{f{b}}}{{Bd{b}}}}{{Bfbn}j}{Bfj}{bb}{{{f{j}}}Bf};`{{{f{db}}bn}h}{{{f{dj}}bn}h}{{{f{dj}}Bf}h}=>=>{c{{Bh{e}}}{}{}}0{{{f{c}}}Bj{}}?``````````````````````````{{}Aj}0{{AjAj}Aj}{{{f{dAj}}Aj}h}10{{{f{Aj}}}Bl}00{Bnl}32{{{f{c}}}{{f{e}}}{}{}}00{{{f{dc}}}{{f{de}}}{}{}}00{{{f{dBn}}}h}{{{f{C`}}}C`}{{{f{Bn}}}Bn}{{{f{c}}}h{}}000{AjAj}0{{{f{Aj}}Aj}n}0;;<<{{}Bn}{{{f{C`}}{f{C`}}}n}{{{f{dAj}}c}h{{Ab{}{{A`{Aj}}}}}}{{{f{Bn}}}b}{{{f{Aj}}{f{dAd}}}Af}0000{{{f{C`}}{f{dAd}}}Af}{{{f{Bn}}{f{dAd}}}Af}{cc{}}{bAj}11{Bl{{An{Aj}}}}0{BlAj}0000{cAj{{Ab{}{{A`{Aj}}}}}}{C`Aj}{{{f{B`}}}{{An{Aj}}}}0{{{f{dAj}}Aj}h}0{{AjAj}Aj}0{{{f{Aj}}Aj}n}0{ce{}{}}00{Ajc{}}{{{f{Aj}}}n}000{{{f{Bn}}}n}00{{{f{Aj}}}{{Bb{Aj}}}}0{{{f{Aj}}}{{Bd{Aj}}}}0{{{f{Aj}}}{{An{C`}}}}{{Bfbn}Bn}{BfBn}{AjAj}{{{f{Bn}}}Bf}=={{{f{dAj}}Ajn}h}0{{{f{dBn}}bn}h}{{{f{dBn}}Bf}h}?{{{f{dAj}}Aj}h}{{AjAj}Aj}011{c{{Bh{e}}}{}{}}00000{{{f{c}}}Bj{}}0022``````````{{}Ah}0{{AhAh}Ah}{{{f{dAh}}Ah}h}10{{{f{Ah}}}l}00{Cbl}32{{{f{c}}}{{f{e}}}{}{}}0{{{f{dc}}}{{f{de}}}{}{}}0{{{f{dCb}}}h}{{{f{Cb}}}Cb}{{{f{c}}}h{}}0{AhAh}0{{{f{Ah}}Ah}n}0::;;{{{f{dAh}}c}h{{Ab{}{{A`{Ah}}}}}}{{{f{Cb}}}b}{{{f{Ah}}{f{dAd}}}Af}0000{{{f{Cb}}{f{dAd}}}Af}{bAh}{cc{}}0{l{{An{Ah}}}}0{lAh}0000{cAh{{Ab{}{{A`{Ah}}}}}}{{{f{B`}}}{{An{Ah}}}}0{{{f{dAh}}Ah}h}0{{AhAh}Ah}0<<{ce{}{}}0{Ahc{}}{{{f{Ah}}}n}000{{{f{Cb}}}n}00{{{f{Ah}}}{{Bb{Ah}}}}0{{{f{Ah}}}{{Bd{Ah}}}}0{{Bfbn}Cb}{BfCb}{AhAh}{{{f{Cb}}}Bf};;{{{f{dAh}}Ahn}h}0{{{f{dCb}}bn}h}{{{f{dCb}}Bf}h}=>==>>{c{{Bh{e}}}{}{}}000{{{f{c}}}Bj{}}0??``````````````````````````{{}Al}{{AlAl}Al}{{{f{dAl}}Al}h}10{Cdl}{{{f{Al}}}Bl}032{{{f{c}}}{{f{e}}}{}{}}0{{{f{dc}}}{{f{de}}}{}{}}0{{{f{dCd}}}h}{{{f{Cd}}}Cd}{{{f{Al}}}Al}{{{f{c}}}h{}}000{{{f{Al}}{f{Al}}}Cf}{AlAl}{{{f{Al}}Al}n}<={{{f{Al}}{f{Al}}}n}{{{f{dAl}}c}h{{Ab{}{{A`{Al}}}}}}{{{f{Cd}}}b}{{{f{Cd}}{f{dAd}}}Af}{{{f{Al}}{f{dAd}}}{{Bh{hCh}}}}0000{cc{}}{bAl}1{Bl{{An{Al}}}}{BlAl}00{cAl{{Ab{}{{A`{Al}}}}}}{{{f{B`}}}{{An{Al}}}}{{{f{Al}}{f{dc}}}hCj}{{{f{dAl}}Al}h}{{AlAl}Al}>{ce{}{}}0{Al}{{{f{Al}}}n}0{{{f{Cd}}}n}00{{{f{Al}}}{{Bb{Al}}}}{{{f{Al}}}{{Bd{Al}}}}{{Bfbn}Cd}{BfCd}{AlAl}{{{f{Cd}}}Bf}{{{f{Al}}{f{Al}}}{{An{Cf}}}}<{{{f{dAl}}Aln}h}{{{f{dCd}}bn}h}{{{f{dCd}}Bf}h}>?>?{c{{Bh{e}}}{}{}}000{{{f{c}}}Bj{}}0{{AlAl}Al}","D":"BBn","p":[[5,"MappingFlags",0],[0,"mut"],[1,"reference"],[1,"unit"],[10,"GenericPTE",0],[1,"usize"],[1,"bool"],[17,"Item"],[10,"IntoIterator",417],[5,"Formatter",418],[8,"Result",418],[5,"PTEFlags",210,419],[5,"DescriptorAttr",77,420],[5,"PTF",313],[6,"Option",421],[1,"str"],[5,"Iter",422],[5,"IterNames",422],[5,"PhysAddr",423],[6,"Result",424],[5,"TypeId",425],[1,"u64"],[5,"A64PTE",77,420],[6,"MemAttr",77,420],[5,"Rv64PTE",210,419],[5,"X64PTE",313,426],[6,"Ordering",427],[5,"Error",418],[10,"Hasher",428]],"r":[[8,429],[64,429],[76,429],[77,420],[85,420],[89,420],[213,419],[215,419],[338,426]],"b":[[15,"impl-MappingFlags"],[16,"impl-Flags-for-MappingFlags"],[32,"impl-Debug-for-MappingFlags"],[33,"impl-Octal-for-MappingFlags"],[34,"impl-LowerHex-for-MappingFlags"],[35,"impl-Binary-for-MappingFlags"],[36,"impl-UpperHex-for-MappingFlags"],[37,"impl-From%3CPTEFlags%3E-for-MappingFlags"],[38,"impl-From%3CDescriptorAttr%3E-for-MappingFlags"],[40,"impl-From%3CPageTableFlags%3E-for-MappingFlags"],[42,"impl-Flags-for-MappingFlags"],[43,"impl-MappingFlags"],[102,"impl-DescriptorAttr"],[103,"impl-DescriptorAttr"],[108,"impl-DescriptorAttr"],[109,"impl-Flags-for-DescriptorAttr"],[110,"impl-DescriptorAttr"],[127,"impl-DescriptorAttr"],[128,"impl-DescriptorAttr"],[129,"impl-DescriptorAttr"],[130,"impl-DescriptorAttr"],[131,"impl-DescriptorAttr"],[132,"impl-DescriptorAttr"],[133,"impl-DescriptorAttr"],[134,"impl-DescriptorAttr"],[139,"impl-Binary-for-DescriptorAttr"],[140,"impl-Debug-for-DescriptorAttr"],[141,"impl-Octal-for-DescriptorAttr"],[142,"impl-LowerHex-for-DescriptorAttr"],[143,"impl-UpperHex-for-DescriptorAttr"],[150,"impl-DescriptorAttr"],[151,"impl-DescriptorAttr"],[152,"impl-Flags-for-DescriptorAttr"],[153,"impl-DescriptorAttr"],[154,"impl-DescriptorAttr"],[155,"impl-DescriptorAttr"],[156,"impl-DescriptorAttr"],[159,"impl-DescriptorAttr"],[160,"impl-DescriptorAttr"],[161,"impl-DescriptorAttr"],[162,"impl-DescriptorAttr"],[163,"impl-DescriptorAttr"],[164,"impl-DescriptorAttr"],[165,"impl-DescriptorAttr"],[166,"impl-DescriptorAttr"],[171,"impl-DescriptorAttr"],[172,"impl-DescriptorAttr"],[173,"impl-DescriptorAttr"],[174,"impl-DescriptorAttr"],[178,"impl-DescriptorAttr"],[179,"impl-DescriptorAttr"],[180,"impl-DescriptorAttr"],[181,"impl-DescriptorAttr"],[187,"impl-DescriptorAttr"],[188,"impl-DescriptorAttr"],[189,"impl-DescriptorAttr"],[190,"impl-DescriptorAttr"],[195,"impl-DescriptorAttr"],[196,"impl-DescriptorAttr"],[197,"impl-DescriptorAttr"],[198,"impl-DescriptorAttr"],[208,"impl-DescriptorAttr"],[209,"impl-DescriptorAttr"],[220,"impl-PTEFlags"],[221,"impl-PTEFlags"],[226,"impl-PTEFlags"],[227,"impl-PTEFlags"],[228,"impl-Flags-for-PTEFlags"],[240,"impl-PTEFlags"],[241,"impl-PTEFlags"],[242,"impl-PTEFlags"],[243,"impl-PTEFlags"],[244,"impl-PTEFlags"],[245,"impl-PTEFlags"],[246,"impl-PTEFlags"],[247,"impl-PTEFlags"],[250,"impl-Binary-for-PTEFlags"],[251,"impl-LowerHex-for-PTEFlags"],[252,"impl-UpperHex-for-PTEFlags"],[253,"impl-Debug-for-PTEFlags"],[254,"impl-Octal-for-PTEFlags"],[259,"impl-PTEFlags"],[260,"impl-PTEFlags"],[261,"impl-PTEFlags"],[262,"impl-Flags-for-PTEFlags"],[263,"impl-PTEFlags"],[264,"impl-PTEFlags"],[265,"impl-PTEFlags"],[267,"impl-PTEFlags"],[268,"impl-PTEFlags"],[269,"impl-PTEFlags"],[270,"impl-PTEFlags"],[271,"impl-PTEFlags"],[272,"impl-PTEFlags"],[273,"impl-PTEFlags"],[274,"impl-PTEFlags"],[278,"impl-PTEFlags"],[279,"impl-PTEFlags"],[280,"impl-PTEFlags"],[281,"impl-PTEFlags"],[285,"impl-PTEFlags"],[286,"impl-PTEFlags"],[287,"impl-PTEFlags"],[288,"impl-PTEFlags"],[293,"impl-PTEFlags"],[294,"impl-PTEFlags"],[295,"impl-PTEFlags"],[296,"impl-PTEFlags"],[301,"impl-PTEFlags"],[302,"impl-PTEFlags"],[303,"impl-PTEFlags"],[304,"impl-PTEFlags"],[311,"impl-PTEFlags"],[312,"impl-PTEFlags"],[345,"impl-PageTableFlags"],[346,"impl-Flags-for-PageTableFlags"],[369,"impl-Debug-for-PageTableFlags"],[370,"impl-Binary-for-PageTableFlags"],[371,"impl-Octal-for-PageTableFlags"],[372,"impl-LowerHex-for-PageTableFlags"],[373,"impl-UpperHex-for-PageTableFlags"],[378,"impl-Flags-for-PageTableFlags"],[379,"impl-PageTableFlags"]],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAIoALgARAAAAFAABABcAAgAeAAAAIQAGACkAAAArAAAANAAAAEkAAgBuAAAAcAAAAHMADACJAAAAiwAHAJQAAACZAAAAqwAAALAAAgC4AAEAuwAAAMAAAQDIAAgA5QABAOkABwD6AAcABwEAABYBAAAbAQIAIgEBACUBAAAqAQEAMgEFAFkBAABbAQAAXgELAG4BAABwAQYAeAEAAHsBAACAAQAAhgEAAIkBAgCOAQEAkQEBAJUBAQCbAQUA"}],\ +["page_table_multiarch",{"t":"PPETPEPPPPTTGFGKKIPPPTCMNNNNNNNNNNMNNNNNNNNNNNNNNNMNCNNNNNNNNNNNNNNNNNCIFNNNNNNNNNNNNNFIFINNNNNNNNNNNNNNNNNNNNNNNNIFNNNNNNN","n":["AlreadyMapped","Err","GenericPTE","LEVELS","MappedToHugePage","MappingFlags","NoMemory","NotAligned","NotMapped","Ok","PA_MAX_ADDR","PA_MAX_BITS","PageSize","PageTable64","PagingError","PagingHandler","PagingMetaData","PagingResult","Size1G","Size2M","Size4K","VA_MAX_BITS","aarch64","alloc_frame","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","dealloc_frame","drop","eq","eq","fmt","fmt","from","from","from","into","into","into","is_huge","map","map_region","paddr_is_valid","phys_to_virt","query","riscv","root_paddr","to_owned","try_from","try_from","try_from","try_into","try_into","try_into","try_new","type_id","type_id","type_id","unmap","unmap_region","update","vaddr_is_valid","walk","x86_64","A64PageTable","A64PagingMetaData","borrow","borrow_mut","clone","clone_into","clone_to_uninit","clone_to_uninit","from","into","to_owned","try_from","try_into","type_id","vaddr_is_valid","Sv39MetaData","Sv39PageTable","Sv48MetaData","Sv48PageTable","borrow","borrow","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","clone_to_uninit","clone_to_uninit","clone_to_uninit","clone_to_uninit","from","from","into","into","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","X64PageTable","X64PagingMetaData","borrow","borrow_mut","from","into","try_from","try_into","type_id"],"q":[[0,"page_table_multiarch"],[71,"page_table_multiarch::aarch64"],[86,"page_table_multiarch::riscv"],[114,"page_table_multiarch::x86_64"],[123,"memory_addr::addr"],[124,"core::option"],[125,"page_table_multiarch::bits64"],[126,"page_table_entry"],[127,"core::fmt"],[128,"core::result"],[129,"core::any"],[130,"core::ops::function"],[131,"page_table_multiarch::arch::aarch64"],[132,"page_table_multiarch::arch::riscv"],[133,"page_table_multiarch::arch"],[134,"page_table_multiarch::arch::x86_64"]],"i":[11,17,0,8,11,0,11,11,11,17,8,8,0,0,0,0,0,0,5,5,5,8,0,10,7,11,5,7,11,5,5,5,5,5,10,7,11,5,11,5,7,11,5,7,11,5,5,7,7,8,10,7,0,7,5,7,11,5,7,11,5,7,7,11,5,7,7,7,8,7,0,0,0,23,23,23,23,23,23,23,23,23,23,23,23,23,0,0,0,0,24,25,24,25,24,25,24,25,24,24,25,25,24,25,24,25,24,25,24,25,24,25,24,25,0,0,26,26,26,26,26,26,26],"f":"```````````````````````{{}{{d{b}}}}{{{f{c}}}{{f{e}}}{}{}}00{{{f{hc}}}{{f{he}}}{}{}}00{{{f{j}}}j}{{{f{c}}{f{he}}}l{}{}}{{{f{c}}}l{}}0{bl}{{{f{h{n{ceg}}}}}lA`AbAd}{{{f{Af}}{f{Af}}}Ah}{{{f{j}}{f{j}}}Ah}{{{f{Af}}{f{hAj}}}Al}{{{f{j}}{f{hAj}}}Al}{cc{}}00{ce{}{}}00{jAh}{{{f{h{n{ceg}}}}AnbjB`}BbA`AbAd}{{{f{h{n{ceg}}}}AnbBdB`Ah}BbA`AbAd}{BdAh}{bAn}{{{f{{n{ceg}}}}An}{{Bb{{Bf{bB`j}}}}}A`AbAd}`{{{f{{n{ceg}}}}}bA`AbAd}{{{f{c}}}e{}{}}{c{{Bh{e}}}{}{}}00000{{}{{Bb{{n{ceg}}}}}A`AbAd}{{{f{c}}}Bj{}}00{{{f{h{n{ceg}}}}An}{{Bb{{Bf{bj}}}}}A`AbAd}{{{f{h{n{ceg}}}}AnBd}BbA`AbAd}{{{f{h{n{ceg}}}}An{d{b}}{d{B`}}}{{Bb{j}}}A`AbAd}:{{{f{{n{ceg}}}}Bd{f{i}}}BbA`AbAd{{Bl{BdBdAn{f{e}}}}}}```{{{f{c}}}{{f{e}}}{}{}}{{{f{hc}}}{{f{he}}}{}{}}{{{f{Bn}}}Bn}{{{f{c}}{f{he}}}l{}{}}{{{f{c}}}l{}}0{cc{}}{ce{}{}}>==;{BdAh}````7766{{{f{C`}}}C`}{{{f{Cb}}}Cb}6655554433{{{f{c}}}e{}{}}0{c{{Bh{e}}}{}{}}000{{{f{c}}}Bj{}}0``<;76110","D":"Gj","p":[[5,"PhysAddr",123],[6,"Option",124],[1,"reference"],[0,"mut"],[6,"PageSize",0],[1,"unit"],[5,"PageTable64",0,125],[10,"PagingMetaData",0],[10,"GenericPTE",126],[10,"PagingHandler",0],[6,"PagingError",0],[1,"bool"],[5,"Formatter",127],[8,"Result",127],[5,"VirtAddr",123],[5,"MappingFlags",126],[8,"PagingResult",0],[1,"usize"],[1,"tuple"],[6,"Result",128],[5,"TypeId",129],[10,"Fn",130],[5,"A64PagingMetaData",71,131],[5,"Sv39MetaData",86,132],[5,"Sv48MetaData",86,132],[5,"X64PagingMetaData",114]],"r":[[2,126],[5,126],[13,125],[22,133],[52,133],[70,133],[71,131],[72,131],[86,132],[87,132],[88,132],[89,132],[114,134],[115,134]],"b":[],"c":"OjAAAAAAAAA=","e":"OzAAAAEAAD4ADAADAAAABgAAABkACQAkAAQANwAGAD8AAgBKAAUAUgAEAFsACwBrAAcAdQABAHkAAgA="}]\ +]')); +if (typeof exports !== 'undefined') exports.searchIndex = searchIndex; +else if (window.initSearch) window.initSearch(searchIndex); diff --git a/search.desc/page_table_entry/page_table_entry-desc-0-.js b/search.desc/page_table_entry/page_table_entry-desc-0-.js new file mode 100644 index 0000000..b05fb3d --- /dev/null +++ b/search.desc/page_table_entry/page_table_entry-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("page_table_entry", 0, "page_table_entry\nThe memory is device memory.\nThe memory is executable.\nA generic page table entry.\nGeneric page table entry flags that indicate the …\nThe memory is readable.\nThe memory is uncached.\nThe memory is user accessible.\nThe memory is writable.\nAArch64 VMSAv8-64 translation table format descriptors.\nGet a flags value with all known bits set.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nReturns the raw bits of this entry.\nGet the underlying bits value.\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nSet this entry to zero.\nThe bitwise negation (!) of the bits in a flags value, …\nWhether all set bits in a source flags value are also set …\nThe intersection of a source flags value with the …\nGet a flags value with all bits unset.\nThe bitwise or (|) of the bits in each flags value.\nReturns the flags of this entry.\nReturns the argument unchanged.\nConvert from a bits value.\nConvert from a bits value exactly.\nConvert from a bits value, unsetting any unknown bits.\nThe bitwise or (|) of the bits in each flags value.\nGet a flags value with the bits of a flag with the given …\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nWhether any set bits in a source flags value are also set …\nCalls U::from(self).\nWhether all known bits in this flags value are set.\nWhether all bits in this flags value are unset.\nFor non-last level translation, returns whether this entry …\nReturns whether this entry flag indicates present.\nReturns whether this entry is zero.\nYield a set of contained flags values.\nYield a set of contained named flags values.\nCreates a page table entry point to a terminate page or …\nCreates a page table entry point to a next level page …\nThe bitwise negation (!) of the bits in a flags value, …\nReturns the physical address mapped by this entry.\nThe intersection of a source flags value with the …\nRISC-V page table entries.\nCall insert when value is true or remove when value is …\nSet flags of the entry.\nSet mapped physical address of the entry.\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise or (|) of the bits in two flags values.\nx86 page table entries on 64-bit paging.\nA VMSAv8-64 translation table descriptor.\nThe Access flag.\nAccess permission: accessable at EL0.\nAccess permissions limit for subsequent levels of lookup: …\nAccess permissions limit for subsequent levels of lookup: …\nAccess permission: read-only.\nMemory attributes index field.\nIndicates that 16 adjacent translation table entries point …\nMemory attribute fields in the VMSAv8-64 translation table …\nDevice-nGnRE memory\nShareability: Inner Shareable (otherwise Outer Shareable).\nThe MAIR_ELx register should be set to this value to match …\nThe memory attributes index field in the descriptor, which …\nThe not global bit.\nThe descriptor gives the address of the next level of …\nNon-secure bit. For memory accesses from Secure state, …\nFor memory accesses from Secure state, specifies the …\nNormal memory\nNormal non-cacheable memory\nThe Privileged execute-never field.\nPXN limit for subsequent levels of lookup.\nShareability: Inner or Outer Shareable (otherwise …\nThe Execute-never or Unprivileged execute-never field.\nWhether the descriptor is valid.\nXN limit for subsequent levels of lookup.\nGet a flags value with all known bits set.\nGet a flags value with all known bits set.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nGet the underlying bits value.\nGet the underlying bits value.\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise negation (!) of the bits in a flags value, …\nThe bitwise negation (!) of the bits in a flags value, …\nWhether all set bits in a source flags value are also set …\nWhether all set bits in a source flags value are also set …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nGet a flags value with all bits unset.\nGet a flags value with all bits unset.\nCreates an empty descriptor with all bits set to zero.\nThe bitwise or (|) of the bits in each flags value.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConvert from a bits value.\nConvert from a bits value.\nConvert from a bits value exactly.\nConvert from a bits value exactly.\nConvert from a bits value, unsetting any unknown bits.\nConvert from a bits value, unsetting any unknown bits.\nThe bitwise or (|) of the bits in each flags value.\nConstructs a descriptor from the memory index, leaving the …\nGet a flags value with the bits of a flag with the given …\nGet a flags value with the bits of a flag with the given …\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nWhether any set bits in a source flags value are also set …\nWhether any set bits in a source flags value are also set …\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether all known bits in this flags value are set.\nWhether all known bits in this flags value are set.\nWhether all bits in this flags value are unset.\nWhether all bits in this flags value are unset.\nYield a set of contained flags values.\nYield a set of contained flags values.\nYield a set of contained named flags values.\nYield a set of contained named flags values.\nReturns the memory attribute index field.\nThe bitwise negation (!) of the bits in a flags value, …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nCall insert when value is true or remove when value is …\nCall insert when value is true or remove when value is …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nIndicates the virtual page has been read, written, or …\nIndicates the virtual page has been written since the last …\nDesignates a global mapping.\nPage-table entry flags.\nWhether the page is readable.\nSv39 and Sv48 page table entry for RV64 systems.\nWhether the page is accessible to user mode.\nWhether the PTE is valid.\nWhether the page is writable.\nWhether the page is executable.\nGet a flags value with all known bits set.\nGet a flags value with all known bits set.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nGet the underlying bits value.\nGet the underlying bits value.\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise negation (!) of the bits in a flags value, …\nThe bitwise negation (!) of the bits in a flags value, …\nWhether all set bits in a source flags value are also set …\nWhether all set bits in a source flags value are also set …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nGet a flags value with all bits unset.\nGet a flags value with all bits unset.\nThe bitwise or (|) of the bits in each flags value.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConvert from a bits value.\nConvert from a bits value.\nConvert from a bits value exactly.\nConvert from a bits value exactly.\nConvert from a bits value, unsetting any unknown bits.\nConvert from a bits value, unsetting any unknown bits.\nThe bitwise or (|) of the bits in each flags value.\nGet a flags value with the bits of a flag with the given …\nGet a flags value with the bits of a flag with the given …\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nWhether any set bits in a source flags value are also set …\nWhether any set bits in a source flags value are also set …\nCalls U::from(self).\nCalls U::from(self).\nWhether all known bits in this flags value are set.\nWhether all known bits in this flags value are set.\nWhether all bits in this flags value are unset.\nWhether all bits in this flags value are unset.\nYield a set of contained flags values.\nYield a set of contained flags values.\nYield a set of contained named flags values.\nYield a set of contained named flags values.\nThe bitwise negation (!) of the bits in a flags value, …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nCall insert when value is true or remove when value is …\nCall insert when value is true or remove when value is …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nSet by the CPU when the mapped frame or page table is …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nAvailable to the OS, can be used to store additional data, …\nSet by the CPU on a write to the mapped frame.\nIndicates that the mapping is present in all address …\nSpecifies that the entry maps a huge frame instead of a …\nDisables caching for the pointed entry is cacheable.\nForbid code execution from the mapped frames.\nSpecifies whether the mapped frame or page table is loaded …\nPossible flags for a page table entry.\nControls whether accesses from userspace (i.e. ring 3) are …\nControls whether writes to the mapped frames are allowed.\nIf this bit is set, a “write-through” policy is used …\nAn x86_64 page table entry.\nGet a flags value with all known bits set.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise or (|) of the bits in two flags values.\nGet the underlying bits value.\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise negation (!) of the bits in a flags value, …\nWhether all set bits in a source flags value are also set …\nThe intersection of a source flags value with the …\nGet a flags value with all bits unset.\nThe bitwise or (|) of the bits in each flags value.\nReturns the argument unchanged.\nReturns the argument unchanged.\nConvert from a bits value.\nConvert from a bits value exactly.\nConvert from a bits value, unsetting any unknown bits.\nThe bitwise or (|) of the bits in each flags value.\nGet a flags value with the bits of a flag with the given …\nThe bitwise or (|) of the bits in two flags values.\nThe bitwise and (&) of the bits in two flags values.\nWhether any set bits in a source flags value are also set …\nCalls U::from(self).\nCalls U::from(self).\nWhether all known bits in this flags value are set.\nWhether all bits in this flags value are unset.\nYield a set of contained flags values.\nYield a set of contained named flags values.\nThe bitwise negation (!) of the bits in a flags value, …\nThe intersection of a source flags value with the …\nCall insert when value is true or remove when value is …\nThe intersection of a source flags value with the …\nThe intersection of a source flags value with the …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise exclusive-or (^) of the bits in two flags …\nThe bitwise or (|) of the bits in two flags values.") \ No newline at end of file diff --git a/search.desc/page_table_multiarch/page_table_multiarch-desc-0-.js b/search.desc/page_table_multiarch/page_table_multiarch-desc-0-.js new file mode 100644 index 0000000..e833a66 --- /dev/null +++ b/search.desc/page_table_multiarch/page_table_multiarch-desc-0-.js @@ -0,0 +1 @@ +searchState.loadedDescShard("page_table_multiarch", 0, "page_table_multiarch\nThe mapping is already present.\nContains the error value\nThe number of levels of the hardware page table.\nThe page table entry represents a huge page, but the …\nCannot allocate memory.\nThe address is not aligned to the page size.\nThe mapping is not present.\nContains the success value\nThe maximum physical address.\nThe maximum number of bits of physical address.\nThe page sizes supported by the hardware page table.\nA generic page table struct for 64-bit platform.\nThe error type for page table operation failures.\nThe low-level OS-dependent helpers that must be provided …\nThe architecture-dependent metadata that must be provided …\nThe specialized Result type for page table operations.\nSize of 1 gigabytes (230 bytes).\nSize of 2 megabytes (221 bytes).\nSize of 4 kilobytes (212 bytes).\nThe maximum number of bits of virtual address.\nAArch64 specific page table structures.\nRequest to allocate a 4K-sized physical frame.\nRequest to free a allocated physical frame.\nReturns the argument unchanged.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nCalls U::from(self).\nWhether this page size is considered huge (larger than 4K).\nMaps a virtual page to a physical frame with the given …\nMap a contiguous virtual memory region to a contiguous …\nWhether a given physical address is valid.\nReturns a virtual address that maps to the given physical …\nQuery the result of the mapping starts with vaddr.\nRISC-V specific page table structures.\nReturns the physical address of the root page table.\nCreates a new page table instance or returns the error.\nUnmaps the mapping starts with vaddr.\nUnmap a contiguous virtual memory region.\nUpdates the target or flags of the mapping starts with …\nWhether a given virtual address is valid.\nWalk the page table recursively.\nx86 specific page table structures.\nAArch64 VMSAv8-64 translation table.\nMetadata of AArch64 page tables.\nReturns the argument unchanged.\nCalls U::from(self).\nMetadata of RISC-V Sv39 page tables.\nSv39: Page-Based 39-bit (3 levels) Virtual-Memory System.\nMetadata of RISC-V Sv48 page tables.\nSv48: Page-Based 48-bit (4 levels) Virtual-Memory System.\nReturns the argument unchanged.\nReturns the argument unchanged.\nCalls U::from(self).\nCalls U::from(self).\nx86_64 page table.\nmetadata of x86_64 page tables.\nReturns the argument unchanged.\nCalls U::from(self).") \ No newline at end of file diff --git a/settings.html b/settings.html new file mode 100644 index 0000000..956605d --- /dev/null +++ b/settings.html @@ -0,0 +1 @@ +Settings

Rustdoc settings

Back
\ No newline at end of file diff --git a/src-files.js b/src-files.js new file mode 100644 index 0000000..fa3bf27 --- /dev/null +++ b/src-files.js @@ -0,0 +1,5 @@ +var srcIndex = new Map(JSON.parse('[\ +["page_table_entry",["",[["arch",[],["aarch64.rs","mod.rs","riscv.rs","x86_64.rs"]]],["lib.rs"]]],\ +["page_table_multiarch",["",[["arch",[],["aarch64.rs","mod.rs","riscv.rs","x86_64.rs"]]],["bits64.rs","lib.rs"]]]\ +]')); +createSrcSidebar(); diff --git a/src/page_table_entry/arch/aarch64.rs.html b/src/page_table_entry/arch/aarch64.rs.html new file mode 100644 index 0000000..ecf3da3 --- /dev/null +++ b/src/page_table_entry/arch/aarch64.rs.html @@ -0,0 +1,493 @@ +aarch64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+
//! AArch64 VMSAv8-64 translation table format descriptors.
+
+use aarch64_cpu::registers::MAIR_EL1;
+use core::fmt;
+use memory_addr::PhysAddr;
+
+use crate::{GenericPTE, MappingFlags};
+
+bitflags::bitflags! {
+    /// Memory attribute fields in the VMSAv8-64 translation table format descriptors.
+    #[derive(Debug)]
+    pub struct DescriptorAttr: u64 {
+        // Attribute fields in stage 1 VMSAv8-64 Block and Page descriptors:
+
+        /// Whether the descriptor is valid.
+        const VALID =       1 << 0;
+        /// The descriptor gives the address of the next level of translation table or 4KB page.
+        /// (not a 2M, 1G block)
+        const NON_BLOCK =   1 << 1;
+        /// Memory attributes index field.
+        const ATTR_INDX =   0b111 << 2;
+        /// Non-secure bit. For memory accesses from Secure state, specifies whether the output
+        /// address is in Secure or Non-secure memory.
+        const NS =          1 << 5;
+        /// Access permission: accessable at EL0.
+        const AP_EL0 =      1 << 6;
+        /// Access permission: read-only.
+        const AP_RO =       1 << 7;
+        /// Shareability: Inner Shareable (otherwise Outer Shareable).
+        const INNER =       1 << 8;
+        /// Shareability: Inner or Outer Shareable (otherwise Non-shareable).
+        const SHAREABLE =   1 << 9;
+        /// The Access flag.
+        const AF =          1 << 10;
+        /// The not global bit.
+        const NG =          1 << 11;
+        /// Indicates that 16 adjacent translation table entries point to contiguous memory regions.
+        const CONTIGUOUS =  1 <<  52;
+        /// The Privileged execute-never field.
+        const PXN =         1 <<  53;
+        /// The Execute-never or Unprivileged execute-never field.
+        const UXN =         1 <<  54;
+
+        // Next-level attributes in stage 1 VMSAv8-64 Table descriptors:
+
+        /// PXN limit for subsequent levels of lookup.
+        const PXN_TABLE =           1 << 59;
+        /// XN limit for subsequent levels of lookup.
+        const XN_TABLE =            1 << 60;
+        /// Access permissions limit for subsequent levels of lookup: access at EL0 not permitted.
+        const AP_NO_EL0_TABLE =     1 << 61;
+        /// Access permissions limit for subsequent levels of lookup: write access not permitted.
+        const AP_NO_WRITE_TABLE =   1 << 62;
+        /// For memory accesses from Secure state, specifies the Security state for subsequent
+        /// levels of lookup.
+        const NS_TABLE =            1 << 63;
+    }
+}
+
+/// The memory attributes index field in the descriptor, which is used to index
+/// into the MAIR (Memory Attribute Indirection Register).
+#[repr(u64)]
+#[derive(Debug, Clone, Copy, Eq, PartialEq)]
+pub enum MemAttr {
+    /// Device-nGnRE memory
+    Device = 0,
+    /// Normal memory
+    Normal = 1,
+    /// Normal non-cacheable memory
+    NormalNonCacheable = 2,
+}
+
+impl DescriptorAttr {
+    #[allow(clippy::unusual_byte_groupings)]
+    const ATTR_INDEX_MASK: u64 = 0b111_00;
+
+    /// Constructs a descriptor from the memory index, leaving the other fields
+    /// empty.
+    pub const fn from_mem_attr(idx: MemAttr) -> Self {
+        let mut bits = (idx as u64) << 2;
+        if matches!(idx, MemAttr::Normal | MemAttr::NormalNonCacheable) {
+            bits |= Self::INNER.bits() | Self::SHAREABLE.bits();
+        }
+        Self::from_bits_retain(bits)
+    }
+
+    /// Returns the memory attribute index field.
+    pub const fn mem_attr(&self) -> Option<MemAttr> {
+        let idx = (self.bits() & Self::ATTR_INDEX_MASK) >> 2;
+        Some(match idx {
+            0 => MemAttr::Device,
+            1 => MemAttr::Normal,
+            2 => MemAttr::NormalNonCacheable,
+            _ => return None,
+        })
+    }
+}
+
+impl MemAttr {
+    /// The MAIR_ELx register should be set to this value to match the memory
+    /// attributes in the descriptors.
+    pub const MAIR_VALUE: u64 = {
+        // Device-nGnRE memory
+        let attr0 = MAIR_EL1::Attr0_Device::nonGathering_nonReordering_EarlyWriteAck.value;
+        // Normal memory
+        let attr1 = MAIR_EL1::Attr1_Normal_Inner::WriteBack_NonTransient_ReadWriteAlloc.value
+            | MAIR_EL1::Attr1_Normal_Outer::WriteBack_NonTransient_ReadWriteAlloc.value;
+        let attr2 = MAIR_EL1::Attr2_Normal_Inner::NonCacheable.value
+            + MAIR_EL1::Attr2_Normal_Outer::NonCacheable.value;
+        attr0 | attr1 | attr2 // 0x44_ff_04
+    };
+}
+
+impl From<DescriptorAttr> for MappingFlags {
+    fn from(attr: DescriptorAttr) -> Self {
+        if !attr.contains(DescriptorAttr::VALID) {
+            return Self::empty();
+        }
+        let mut flags = Self::READ;
+        if !attr.contains(DescriptorAttr::AP_RO) {
+            flags |= Self::WRITE;
+        }
+        if attr.contains(DescriptorAttr::AP_EL0) {
+            flags |= Self::USER;
+            if !attr.contains(DescriptorAttr::UXN) {
+                flags |= Self::EXECUTE;
+            }
+        } else if !attr.intersects(DescriptorAttr::PXN) {
+            flags |= Self::EXECUTE;
+        }
+        match attr.mem_attr() {
+            Some(MemAttr::Device) => flags |= Self::DEVICE,
+            Some(MemAttr::NormalNonCacheable) => flags |= Self::UNCACHED,
+            _ => {}
+        }
+        flags
+    }
+}
+
+impl From<MappingFlags> for DescriptorAttr {
+    fn from(flags: MappingFlags) -> Self {
+        if flags.is_empty() {
+            return Self::empty();
+        }
+        let mut attr = if flags.contains(MappingFlags::DEVICE) {
+            Self::from_mem_attr(MemAttr::Device)
+        } else if flags.contains(MappingFlags::UNCACHED) {
+            Self::from_mem_attr(MemAttr::NormalNonCacheable)
+        } else {
+            Self::from_mem_attr(MemAttr::Normal)
+        };
+        if flags.contains(MappingFlags::READ) {
+            attr |= Self::VALID;
+        }
+        if !flags.contains(MappingFlags::WRITE) {
+            attr |= Self::AP_RO;
+        }
+        if flags.contains(MappingFlags::USER) {
+            attr |= Self::AP_EL0 | Self::PXN;
+            if !flags.contains(MappingFlags::EXECUTE) {
+                attr |= Self::UXN;
+            }
+        } else {
+            attr |= Self::UXN;
+            if !flags.contains(MappingFlags::EXECUTE) {
+                attr |= Self::PXN;
+            }
+        }
+        attr
+    }
+}
+
+/// A VMSAv8-64 translation table descriptor.
+///
+/// Note that the **AttrIndx\[2:0\]** (bit\[4:2\]) field is set to `0` for device
+/// memory, and `1` for normal memory. The system must configure the MAIR_ELx
+/// system register accordingly.
+#[derive(Clone, Copy)]
+#[repr(transparent)]
+pub struct A64PTE(u64);
+
+impl A64PTE {
+    const PHYS_ADDR_MASK: u64 = 0x0000_ffff_ffff_f000; // bits 12..48
+
+    /// Creates an empty descriptor with all bits set to zero.
+    pub const fn empty() -> Self {
+        Self(0)
+    }
+}
+
+impl GenericPTE for A64PTE {
+    fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self {
+        let mut attr = DescriptorAttr::from(flags) | DescriptorAttr::AF;
+        if !is_huge {
+            attr |= DescriptorAttr::NON_BLOCK;
+        }
+        Self(attr.bits() | (paddr.as_usize() as u64 & Self::PHYS_ADDR_MASK))
+    }
+    fn new_table(paddr: PhysAddr) -> Self {
+        let attr = DescriptorAttr::NON_BLOCK | DescriptorAttr::VALID;
+        Self(attr.bits() | (paddr.as_usize() as u64 & Self::PHYS_ADDR_MASK))
+    }
+    fn paddr(&self) -> PhysAddr {
+        PhysAddr::from((self.0 & Self::PHYS_ADDR_MASK) as usize)
+    }
+    fn flags(&self) -> MappingFlags {
+        DescriptorAttr::from_bits_truncate(self.0).into()
+    }
+    fn set_paddr(&mut self, paddr: PhysAddr) {
+        self.0 = (self.0 & !Self::PHYS_ADDR_MASK) | (paddr.as_usize() as u64 & Self::PHYS_ADDR_MASK)
+    }
+    fn set_flags(&mut self, flags: MappingFlags, is_huge: bool) {
+        let mut attr = DescriptorAttr::from(flags) | DescriptorAttr::AF;
+        if !is_huge {
+            attr |= DescriptorAttr::NON_BLOCK;
+        }
+        self.0 = (self.0 & Self::PHYS_ADDR_MASK) | attr.bits();
+    }
+
+    fn bits(self) -> usize {
+        self.0 as usize
+    }
+    fn is_unused(&self) -> bool {
+        self.0 == 0
+    }
+    fn is_present(&self) -> bool {
+        DescriptorAttr::from_bits_truncate(self.0).contains(DescriptorAttr::VALID)
+    }
+    fn is_huge(&self) -> bool {
+        !DescriptorAttr::from_bits_truncate(self.0).contains(DescriptorAttr::NON_BLOCK)
+    }
+    fn clear(&mut self) {
+        self.0 = 0
+    }
+}
+
+impl fmt::Debug for A64PTE {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut f = f.debug_struct("A64PTE");
+        f.field("raw", &self.0)
+            .field("paddr", &self.paddr())
+            .field("attr", &DescriptorAttr::from_bits_truncate(self.0))
+            .field("flags", &self.flags())
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/page_table_entry/arch/mod.rs.html b/src/page_table_entry/arch/mod.rs.html new file mode 100644 index 0000000..0d0fcb2 --- /dev/null +++ b/src/page_table_entry/arch/mod.rs.html @@ -0,0 +1,19 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+
#[cfg(target_arch = "x86_64")]
+pub mod x86_64;
+
+#[doc(cfg(any(target_arch = "riscv32", target_arch = "riscv64")))]
+pub mod riscv;
+
+// TODO: `#[cfg(any(target_arch = "aarch64", doc))]` does not work.
+#[doc(cfg(target_arch = "aarch64"))]
+pub mod aarch64;
+
\ No newline at end of file diff --git a/src/page_table_entry/arch/riscv.rs.html b/src/page_table_entry/arch/riscv.rs.html new file mode 100644 index 0000000..2d00e49 --- /dev/null +++ b/src/page_table_entry/arch/riscv.rs.html @@ -0,0 +1,273 @@ +riscv.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+
//! RISC-V page table entries.
+
+use core::fmt;
+use memory_addr::PhysAddr;
+
+use crate::{GenericPTE, MappingFlags};
+
+bitflags::bitflags! {
+    /// Page-table entry flags.
+    #[derive(Debug)]
+    pub struct PTEFlags: usize {
+        /// Whether the PTE is valid.
+        const V =   1 << 0;
+        /// Whether the page is readable.
+        const R =   1 << 1;
+        /// Whether the page is writable.
+        const W =   1 << 2;
+        /// Whether the page is executable.
+        const X =   1 << 3;
+        /// Whether the page is accessible to user mode.
+        const U =   1 << 4;
+        /// Designates a global mapping.
+        const G =   1 << 5;
+        /// Indicates the virtual page has been read, written, or fetched from
+        /// since the last time the A bit was cleared.
+        const A =   1 << 6;
+        /// Indicates the virtual page has been written since the last time the
+        /// D bit was cleared.
+        const D =   1 << 7;
+    }
+}
+
+impl From<PTEFlags> for MappingFlags {
+    fn from(f: PTEFlags) -> Self {
+        let mut ret = Self::empty();
+        if !f.contains(PTEFlags::V) {
+            return ret;
+        }
+        if f.contains(PTEFlags::R) {
+            ret |= Self::READ;
+        }
+        if f.contains(PTEFlags::W) {
+            ret |= Self::WRITE;
+        }
+        if f.contains(PTEFlags::X) {
+            ret |= Self::EXECUTE;
+        }
+        if f.contains(PTEFlags::U) {
+            ret |= Self::USER;
+        }
+        ret
+    }
+}
+
+impl From<MappingFlags> for PTEFlags {
+    fn from(f: MappingFlags) -> Self {
+        if f.is_empty() {
+            return Self::empty();
+        }
+        let mut ret = Self::V;
+        if f.contains(MappingFlags::READ) {
+            ret |= Self::R;
+        }
+        if f.contains(MappingFlags::WRITE) {
+            ret |= Self::W;
+        }
+        if f.contains(MappingFlags::EXECUTE) {
+            ret |= Self::X;
+        }
+        if f.contains(MappingFlags::USER) {
+            ret |= Self::U;
+        }
+        ret
+    }
+}
+
+/// Sv39 and Sv48 page table entry for RV64 systems.
+#[derive(Clone, Copy)]
+#[repr(transparent)]
+pub struct Rv64PTE(u64);
+
+impl Rv64PTE {
+    const PHYS_ADDR_MASK: u64 = (1 << 54) - (1 << 10); // bits 10..54
+}
+
+impl GenericPTE for Rv64PTE {
+    fn new_page(paddr: PhysAddr, flags: MappingFlags, _is_huge: bool) -> Self {
+        let flags = PTEFlags::from(flags) | PTEFlags::A | PTEFlags::D;
+        debug_assert!(flags.intersects(PTEFlags::R | PTEFlags::X));
+        Self(flags.bits() as u64 | ((paddr.as_usize() >> 2) as u64 & Self::PHYS_ADDR_MASK))
+    }
+    fn new_table(paddr: PhysAddr) -> Self {
+        Self(PTEFlags::V.bits() as u64 | ((paddr.as_usize() >> 2) as u64 & Self::PHYS_ADDR_MASK))
+    }
+    fn paddr(&self) -> PhysAddr {
+        PhysAddr::from(((self.0 & Self::PHYS_ADDR_MASK) << 2) as usize)
+    }
+    fn flags(&self) -> MappingFlags {
+        PTEFlags::from_bits_truncate(self.0 as usize).into()
+    }
+    fn set_paddr(&mut self, paddr: PhysAddr) {
+        self.0 = (self.0 & !Self::PHYS_ADDR_MASK)
+            | ((paddr.as_usize() as u64 >> 2) & Self::PHYS_ADDR_MASK);
+    }
+    fn set_flags(&mut self, flags: MappingFlags, _is_huge: bool) {
+        let flags = PTEFlags::from(flags) | PTEFlags::A | PTEFlags::D;
+        debug_assert!(flags.intersects(PTEFlags::R | PTEFlags::X));
+        self.0 = (self.0 & Self::PHYS_ADDR_MASK) | flags.bits() as u64;
+    }
+
+    fn bits(self) -> usize {
+        self.0 as usize
+    }
+    fn is_unused(&self) -> bool {
+        self.0 == 0
+    }
+    fn is_present(&self) -> bool {
+        PTEFlags::from_bits_truncate(self.0 as usize).contains(PTEFlags::V)
+    }
+    fn is_huge(&self) -> bool {
+        PTEFlags::from_bits_truncate(self.0 as usize).intersects(PTEFlags::R | PTEFlags::X)
+    }
+    fn clear(&mut self) {
+        self.0 = 0
+    }
+}
+
+impl fmt::Debug for Rv64PTE {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut f = f.debug_struct("Rv64PTE");
+        f.field("raw", &self.0)
+            .field("paddr", &self.paddr())
+            .field("flags", &self.flags())
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/page_table_entry/arch/x86_64.rs.html b/src/page_table_entry/arch/x86_64.rs.html new file mode 100644 index 0000000..e4c5264 --- /dev/null +++ b/src/page_table_entry/arch/x86_64.rs.html @@ -0,0 +1,235 @@ +x86_64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+
//! x86 page table entries on 64-bit paging.
+
+use core::fmt;
+use memory_addr::PhysAddr;
+
+pub use x86_64::structures::paging::page_table::PageTableFlags as PTF;
+
+use crate::{GenericPTE, MappingFlags};
+
+impl From<PTF> for MappingFlags {
+    fn from(f: PTF) -> Self {
+        if !f.contains(PTF::PRESENT) {
+            return Self::empty();
+        }
+        let mut ret = Self::READ;
+        if f.contains(PTF::WRITABLE) {
+            ret |= Self::WRITE;
+        }
+        if !f.contains(PTF::NO_EXECUTE) {
+            ret |= Self::EXECUTE;
+        }
+        if f.contains(PTF::USER_ACCESSIBLE) {
+            ret |= Self::USER;
+        }
+        if f.contains(PTF::NO_CACHE) {
+            ret |= Self::UNCACHED;
+        }
+        ret
+    }
+}
+
+impl From<MappingFlags> for PTF {
+    fn from(f: MappingFlags) -> Self {
+        if f.is_empty() {
+            return Self::empty();
+        }
+        let mut ret = Self::PRESENT;
+        if f.contains(MappingFlags::WRITE) {
+            ret |= Self::WRITABLE;
+        }
+        if !f.contains(MappingFlags::EXECUTE) {
+            ret |= Self::NO_EXECUTE;
+        }
+        if f.contains(MappingFlags::USER) {
+            ret |= Self::USER_ACCESSIBLE;
+        }
+        if f.contains(MappingFlags::DEVICE) || f.contains(MappingFlags::UNCACHED) {
+            ret |= Self::NO_CACHE | Self::WRITE_THROUGH;
+        }
+        ret
+    }
+}
+
+/// An x86_64 page table entry.
+#[derive(Clone, Copy)]
+#[repr(transparent)]
+pub struct X64PTE(u64);
+
+impl X64PTE {
+    const PHYS_ADDR_MASK: u64 = 0x000f_ffff_ffff_f000; // bits 12..52
+}
+
+impl GenericPTE for X64PTE {
+    fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self {
+        let mut flags = PTF::from(flags);
+        if is_huge {
+            flags |= PTF::HUGE_PAGE;
+        }
+        Self(flags.bits() | (paddr.as_usize() as u64 & Self::PHYS_ADDR_MASK))
+    }
+    fn new_table(paddr: PhysAddr) -> Self {
+        let flags = PTF::PRESENT | PTF::WRITABLE | PTF::USER_ACCESSIBLE;
+        Self(flags.bits() | (paddr.as_usize() as u64 & Self::PHYS_ADDR_MASK))
+    }
+    fn paddr(&self) -> PhysAddr {
+        PhysAddr::from((self.0 & Self::PHYS_ADDR_MASK) as usize)
+    }
+    fn flags(&self) -> MappingFlags {
+        PTF::from_bits_truncate(self.0).into()
+    }
+    fn set_paddr(&mut self, paddr: PhysAddr) {
+        self.0 = (self.0 & !Self::PHYS_ADDR_MASK) | (paddr.as_usize() as u64 & Self::PHYS_ADDR_MASK)
+    }
+    fn set_flags(&mut self, flags: MappingFlags, is_huge: bool) {
+        let mut flags = PTF::from(flags);
+        if is_huge {
+            flags |= PTF::HUGE_PAGE;
+        }
+        self.0 = (self.0 & Self::PHYS_ADDR_MASK) | flags.bits()
+    }
+
+    fn bits(self) -> usize {
+        self.0 as usize
+    }
+    fn is_unused(&self) -> bool {
+        self.0 == 0
+    }
+    fn is_present(&self) -> bool {
+        PTF::from_bits_truncate(self.0).contains(PTF::PRESENT)
+    }
+    fn is_huge(&self) -> bool {
+        PTF::from_bits_truncate(self.0).contains(PTF::HUGE_PAGE)
+    }
+    fn clear(&mut self) {
+        self.0 = 0
+    }
+}
+
+impl fmt::Debug for X64PTE {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        let mut f = f.debug_struct("X64PTE");
+        f.field("raw", &self.0)
+            .field("paddr", &self.paddr())
+            .field("flags", &self.flags())
+            .finish()
+    }
+}
+
\ No newline at end of file diff --git a/src/page_table_entry/lib.rs.html b/src/page_table_entry/lib.rs.html new file mode 100644 index 0000000..c40198e --- /dev/null +++ b/src/page_table_entry/lib.rs.html @@ -0,0 +1,139 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+
#![cfg_attr(not(test), no_std)]
+#![feature(doc_auto_cfg)]
+#![feature(doc_cfg)]
+#![doc = include_str!("../README.md")]
+
+mod arch;
+
+use core::fmt::{self, Debug};
+use memory_addr::PhysAddr;
+
+pub use self::arch::*;
+
+bitflags::bitflags! {
+    /// Generic page table entry flags that indicate the corresponding mapped
+    /// memory region permissions and attributes.
+    #[derive(Clone, Copy, PartialEq)]
+    pub struct MappingFlags: usize {
+        /// The memory is readable.
+        const READ          = 1 << 0;
+        /// The memory is writable.
+        const WRITE         = 1 << 1;
+        /// The memory is executable.
+        const EXECUTE       = 1 << 2;
+        /// The memory is user accessible.
+        const USER          = 1 << 3;
+        /// The memory is device memory.
+        const DEVICE        = 1 << 4;
+        /// The memory is uncached.
+        const UNCACHED      = 1 << 5;
+    }
+}
+
+impl Debug for MappingFlags {
+    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        Debug::fmt(&self.0, f)
+    }
+}
+
+/// A generic page table entry.
+///
+/// All architecture-specific page table entry types implement this trait.
+pub trait GenericPTE: Debug + Clone + Copy + Sync + Send + Sized {
+    /// Creates a page table entry point to a terminate page or block.
+    fn new_page(paddr: PhysAddr, flags: MappingFlags, is_huge: bool) -> Self;
+    /// Creates a page table entry point to a next level page table.
+    fn new_table(paddr: PhysAddr) -> Self;
+
+    /// Returns the physical address mapped by this entry.
+    fn paddr(&self) -> PhysAddr;
+    /// Returns the flags of this entry.
+    fn flags(&self) -> MappingFlags;
+
+    /// Set mapped physical address of the entry.
+    fn set_paddr(&mut self, paddr: PhysAddr);
+    /// Set flags of the entry.
+    fn set_flags(&mut self, flags: MappingFlags, is_huge: bool);
+
+    /// Returns the raw bits of this entry.
+    fn bits(self) -> usize;
+    /// Returns whether this entry is zero.
+    fn is_unused(&self) -> bool;
+    /// Returns whether this entry flag indicates present.
+    fn is_present(&self) -> bool;
+    /// For non-last level translation, returns whether this entry maps to a
+    /// huge frame.
+    fn is_huge(&self) -> bool;
+    /// Set this entry to zero.
+    fn clear(&mut self);
+}
+
\ No newline at end of file diff --git a/src/page_table_multiarch/arch/aarch64.rs.html b/src/page_table_multiarch/arch/aarch64.rs.html new file mode 100644 index 0000000..54da4f1 --- /dev/null +++ b/src/page_table_multiarch/arch/aarch64.rs.html @@ -0,0 +1,45 @@ +aarch64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+
//! AArch64 specific page table structures.
+
+use crate::{PageTable64, PagingMetaData};
+use page_table_entry::aarch64::A64PTE;
+
+/// Metadata of AArch64 page tables.
+#[derive(Copy, Clone)]
+pub struct A64PagingMetaData;
+
+impl PagingMetaData for A64PagingMetaData {
+    const LEVELS: usize = 4;
+    const PA_MAX_BITS: usize = 48;
+    const VA_MAX_BITS: usize = 48;
+
+    fn vaddr_is_valid(vaddr: usize) -> bool {
+        let top_bits = vaddr >> Self::VA_MAX_BITS;
+        top_bits == 0 || top_bits == 0xffff
+    }
+}
+
+/// AArch64 VMSAv8-64 translation table.
+pub type A64PageTable<H> = PageTable64<A64PagingMetaData, A64PTE, H>;
+
\ No newline at end of file diff --git a/src/page_table_multiarch/arch/mod.rs.html b/src/page_table_multiarch/arch/mod.rs.html new file mode 100644 index 0000000..0c2972b --- /dev/null +++ b/src/page_table_multiarch/arch/mod.rs.html @@ -0,0 +1,17 @@ +mod.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+
#[cfg(any(target_arch = "x86_64", doc))]
+pub mod x86_64;
+
+#[cfg(any(target_arch = "riscv32", target_arch = "riscv64", doc))]
+pub mod riscv;
+
+#[cfg(any(target_arch = "aarch64", doc))]
+pub mod aarch64;
+
\ No newline at end of file diff --git a/src/page_table_multiarch/arch/riscv.rs.html b/src/page_table_multiarch/arch/riscv.rs.html new file mode 100644 index 0000000..26bcfe4 --- /dev/null +++ b/src/page_table_multiarch/arch/riscv.rs.html @@ -0,0 +1,61 @@ +riscv.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+
//! RISC-V specific page table structures.
+
+use crate::{PageTable64, PagingMetaData};
+use page_table_entry::riscv::Rv64PTE;
+
+/// Metadata of RISC-V Sv39 page tables.
+#[derive(Clone, Copy)]
+pub struct Sv39MetaData;
+
+/// Metadata of RISC-V Sv48 page tables.
+#[derive(Clone, Copy)]
+pub struct Sv48MetaData;
+
+impl PagingMetaData for Sv39MetaData {
+    const LEVELS: usize = 3;
+    const PA_MAX_BITS: usize = 56;
+    const VA_MAX_BITS: usize = 39;
+}
+
+impl PagingMetaData for Sv48MetaData {
+    const LEVELS: usize = 4;
+    const PA_MAX_BITS: usize = 56;
+    const VA_MAX_BITS: usize = 48;
+}
+
+/// Sv39: Page-Based 39-bit (3 levels) Virtual-Memory System.
+pub type Sv39PageTable<H> = PageTable64<Sv39MetaData, Rv64PTE, H>;
+
+/// Sv48: Page-Based 48-bit (4 levels) Virtual-Memory System.
+pub type Sv48PageTable<H> = PageTable64<Sv48MetaData, Rv64PTE, H>;
+
\ No newline at end of file diff --git a/src/page_table_multiarch/arch/x86_64.rs.html b/src/page_table_multiarch/arch/x86_64.rs.html new file mode 100644 index 0000000..444545b --- /dev/null +++ b/src/page_table_multiarch/arch/x86_64.rs.html @@ -0,0 +1,33 @@ +x86_64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+
//! x86 specific page table structures.
+
+use crate::{PageTable64, PagingMetaData};
+use page_table_entry::x86_64::X64PTE;
+
+/// metadata of x86_64 page tables.
+pub struct X64PagingMetaData;
+
+impl PagingMetaData for X64PagingMetaData {
+    const LEVELS: usize = 4;
+    const PA_MAX_BITS: usize = 52;
+    const VA_MAX_BITS: usize = 48;
+}
+
+/// x86_64 page table.
+pub type X64PageTable<H> = PageTable64<X64PagingMetaData, X64PTE, H>;
+
\ No newline at end of file diff --git a/src/page_table_multiarch/bits64.rs.html b/src/page_table_multiarch/bits64.rs.html new file mode 100644 index 0000000..8cbfc9f --- /dev/null +++ b/src/page_table_multiarch/bits64.rs.html @@ -0,0 +1,773 @@ +bits64.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+105
+106
+107
+108
+109
+110
+111
+112
+113
+114
+115
+116
+117
+118
+119
+120
+121
+122
+123
+124
+125
+126
+127
+128
+129
+130
+131
+132
+133
+134
+135
+136
+137
+138
+139
+140
+141
+142
+143
+144
+145
+146
+147
+148
+149
+150
+151
+152
+153
+154
+155
+156
+157
+158
+159
+160
+161
+162
+163
+164
+165
+166
+167
+168
+169
+170
+171
+172
+173
+174
+175
+176
+177
+178
+179
+180
+181
+182
+183
+184
+185
+186
+187
+188
+189
+190
+191
+192
+193
+194
+195
+196
+197
+198
+199
+200
+201
+202
+203
+204
+205
+206
+207
+208
+209
+210
+211
+212
+213
+214
+215
+216
+217
+218
+219
+220
+221
+222
+223
+224
+225
+226
+227
+228
+229
+230
+231
+232
+233
+234
+235
+236
+237
+238
+239
+240
+241
+242
+243
+244
+245
+246
+247
+248
+249
+250
+251
+252
+253
+254
+255
+256
+257
+258
+259
+260
+261
+262
+263
+264
+265
+266
+267
+268
+269
+270
+271
+272
+273
+274
+275
+276
+277
+278
+279
+280
+281
+282
+283
+284
+285
+286
+287
+288
+289
+290
+291
+292
+293
+294
+295
+296
+297
+298
+299
+300
+301
+302
+303
+304
+305
+306
+307
+308
+309
+310
+311
+312
+313
+314
+315
+316
+317
+318
+319
+320
+321
+322
+323
+324
+325
+326
+327
+328
+329
+330
+331
+332
+333
+334
+335
+336
+337
+338
+339
+340
+341
+342
+343
+344
+345
+346
+347
+348
+349
+350
+351
+352
+353
+354
+355
+356
+357
+358
+359
+360
+361
+362
+363
+364
+365
+366
+367
+368
+369
+370
+371
+372
+373
+374
+375
+376
+377
+378
+379
+380
+381
+382
+383
+384
+385
+386
+
extern crate alloc;
+
+use alloc::{vec, vec::Vec};
+use core::marker::PhantomData;
+
+use memory_addr::{PhysAddr, VirtAddr, PAGE_SIZE_4K};
+
+use crate::{GenericPTE, PagingHandler, PagingMetaData};
+use crate::{MappingFlags, PageSize, PagingError, PagingResult};
+
+const ENTRY_COUNT: usize = 512;
+
+const fn p4_index(vaddr: VirtAddr) -> usize {
+    (vaddr.as_usize() >> (12 + 27)) & (ENTRY_COUNT - 1)
+}
+
+const fn p3_index(vaddr: VirtAddr) -> usize {
+    (vaddr.as_usize() >> (12 + 18)) & (ENTRY_COUNT - 1)
+}
+
+const fn p2_index(vaddr: VirtAddr) -> usize {
+    (vaddr.as_usize() >> (12 + 9)) & (ENTRY_COUNT - 1)
+}
+
+const fn p1_index(vaddr: VirtAddr) -> usize {
+    (vaddr.as_usize() >> 12) & (ENTRY_COUNT - 1)
+}
+
+/// A generic page table struct for 64-bit platform.
+///
+/// It also tracks all intermediate level tables. They will be deallocated
+/// When the [`PageTable64`] itself is dropped.
+pub struct PageTable64<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> {
+    root_paddr: PhysAddr,
+    intrm_tables: Vec<PhysAddr>,
+    _phantom: PhantomData<(M, PTE, H)>,
+}
+
+impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> PageTable64<M, PTE, H> {
+    /// Creates a new page table instance or returns the error.
+    ///
+    /// It will allocate a new page for the root page table.
+    pub fn try_new() -> PagingResult<Self> {
+        let root_paddr = Self::alloc_table()?;
+        Ok(Self {
+            root_paddr,
+            intrm_tables: vec![root_paddr],
+            _phantom: PhantomData,
+        })
+    }
+
+    /// Returns the physical address of the root page table.
+    pub const fn root_paddr(&self) -> PhysAddr {
+        self.root_paddr
+    }
+
+    /// Maps a virtual page to a physical frame with the given `page_size`
+    /// and mapping `flags`.
+    ///
+    /// The virtual page starts with `vaddr`, amd the physical frame starts with
+    /// `target`. If the addresses is not aligned to the page size, they will be
+    /// aligned down automatically.
+    ///
+    /// Returns [`Err(PagingError::AlreadyMapped)`](PagingError::AlreadyMapped)
+    /// if the mapping is already present.
+    pub fn map(
+        &mut self,
+        vaddr: VirtAddr,
+        target: PhysAddr,
+        page_size: PageSize,
+        flags: MappingFlags,
+    ) -> PagingResult {
+        let entry = self.get_entry_mut_or_create(vaddr, page_size)?;
+        if !entry.is_unused() {
+            return Err(PagingError::AlreadyMapped);
+        }
+        *entry = GenericPTE::new_page(target.align_down(page_size), flags, page_size.is_huge());
+        Ok(())
+    }
+
+    /// Unmaps the mapping starts with `vaddr`.
+    ///
+    /// Returns [`Err(PagingError::NotMapped)`](PagingError::NotMapped) if the
+    /// mapping is not present.
+    pub fn unmap(&mut self, vaddr: VirtAddr) -> PagingResult<(PhysAddr, PageSize)> {
+        let (entry, size) = self.get_entry_mut(vaddr)?;
+        if entry.is_unused() {
+            return Err(PagingError::NotMapped);
+        }
+        let paddr = entry.paddr();
+        entry.clear();
+        Ok((paddr, size))
+    }
+
+    /// Query the result of the mapping starts with `vaddr`.
+    ///
+    /// Returns the physical address of the target frame, mapping flags, and
+    /// the page size.
+    ///
+    /// Returns [`Err(PagingError::NotMapped)`](PagingError::NotMapped) if the
+    /// mapping is not present.
+    pub fn query(&self, vaddr: VirtAddr) -> PagingResult<(PhysAddr, MappingFlags, PageSize)> {
+        let (entry, size) = self.get_entry_mut(vaddr)?;
+        if entry.is_unused() {
+            return Err(PagingError::NotMapped);
+        }
+        let off = vaddr.align_offset(size);
+        Ok((entry.paddr() + off, entry.flags(), size))
+    }
+
+    /// Updates the target or flags of the mapping starts with `vaddr`. If the
+    /// corresponding argument is `None`, it will not be updated.
+    ///
+    /// Returns the page size of the mapping.
+    ///
+    /// Returns [`Err(PagingError::NotMapped)`](PagingError::NotMapped) if the
+    /// mapping is not present.
+    pub fn update(
+        &mut self,
+        vaddr: VirtAddr,
+        paddr: Option<PhysAddr>,
+        flags: Option<MappingFlags>,
+    ) -> PagingResult<PageSize> {
+        let (entry, size) = self.get_entry_mut(vaddr)?;
+        if let Some(paddr) = paddr {
+            entry.set_paddr(paddr);
+        }
+        if let Some(flags) = flags {
+            entry.set_flags(flags, size.is_huge());
+        }
+        Ok(size)
+    }
+
+    /// Map a contiguous virtual memory region to a contiguous physical memory
+    /// region with the given mapping `flags`.
+    ///
+    /// The virtual and physical memory regions start with `vaddr` and `paddr`
+    /// respectively. The region size is `size`. The addresses and `size` must
+    /// be aligned to 4K, otherwise it will return [`Err(PagingError::NotAligned)`].
+    ///
+    /// When `allow_huge` is true, it will try to map the region with huge pages
+    /// if possible. Otherwise, it will map the region with 4K pages.
+    ///
+    /// [`Err(PagingError::NotAligned)`]: PagingError::NotAligned
+    pub fn map_region(
+        &mut self,
+        vaddr: VirtAddr,
+        paddr: PhysAddr,
+        size: usize,
+        flags: MappingFlags,
+        allow_huge: bool,
+    ) -> PagingResult {
+        if !vaddr.is_aligned(PageSize::Size4K)
+            || !paddr.is_aligned(PageSize::Size4K)
+            || !memory_addr::is_aligned(size, PageSize::Size4K.into())
+        {
+            return Err(PagingError::NotAligned);
+        }
+        trace!(
+            "map_region({:#x}): [{:#x}, {:#x}) -> [{:#x}, {:#x}) {:?}",
+            self.root_paddr(),
+            vaddr,
+            vaddr + size,
+            paddr,
+            paddr + size,
+            flags,
+        );
+        let mut vaddr = vaddr;
+        let mut paddr = paddr;
+        let mut size = size;
+        while size > 0 {
+            let page_size = if allow_huge {
+                if vaddr.is_aligned(PageSize::Size1G)
+                    && paddr.is_aligned(PageSize::Size1G)
+                    && size >= PageSize::Size1G as usize
+                {
+                    PageSize::Size1G
+                } else if vaddr.is_aligned(PageSize::Size2M)
+                    && paddr.is_aligned(PageSize::Size2M)
+                    && size >= PageSize::Size2M as usize
+                {
+                    PageSize::Size2M
+                } else {
+                    PageSize::Size4K
+                }
+            } else {
+                PageSize::Size4K
+            };
+            self.map(vaddr, paddr, page_size, flags).inspect_err(|e| {
+                error!(
+                    "failed to map page: {:#x?}({:?}) -> {:#x?}, {:?}",
+                    vaddr, page_size, paddr, e
+                )
+            })?;
+            vaddr += page_size as usize;
+            paddr += page_size as usize;
+            size -= page_size as usize;
+        }
+        Ok(())
+    }
+
+    /// Unmap a contiguous virtual memory region.
+    ///
+    /// The region must be mapped before using [`PageTable64::map_region`], or
+    /// unexpected behaviors may occur.
+    pub fn unmap_region(&mut self, vaddr: VirtAddr, size: usize) -> PagingResult {
+        trace!(
+            "unmap_region({:#x}) [{:#x}, {:#x})",
+            self.root_paddr(),
+            vaddr,
+            vaddr + size,
+        );
+        let mut vaddr = vaddr;
+        let mut size = size;
+        while size > 0 {
+            let (_, page_size) = self
+                .unmap(vaddr)
+                .inspect_err(|e| error!("failed to unmap page: {:#x?}, {:?}", vaddr, e))?;
+            assert!(vaddr.is_aligned(page_size));
+            assert!(page_size as usize <= size);
+            vaddr += page_size as usize;
+            size -= page_size as usize;
+        }
+        Ok(())
+    }
+
+    /// Walk the page table recursively.
+    ///
+    /// When reaching the leaf page table, call `func` on the current page table
+    /// entry. The max number of enumerations in one table is limited by `limit`.
+    ///
+    /// The arguments of `func` are:
+    /// - Current level (starts with `0`): `usize`
+    /// - The index of the entry in the current-level table: `usize`
+    /// - The virtual address that is mapped to the entry: [`VirtAddr`]
+    /// - The reference of the entry: [`&PTE`](GenericPTE)
+    pub fn walk<F>(&self, limit: usize, func: &F) -> PagingResult
+    where
+        F: Fn(usize, usize, VirtAddr, &PTE),
+    {
+        self.walk_recursive(
+            self.table_of(self.root_paddr()),
+            0,
+            VirtAddr::from(0),
+            limit,
+            func,
+        )
+    }
+}
+
+// Private implements.
+impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> PageTable64<M, PTE, H> {
+    fn alloc_table() -> PagingResult<PhysAddr> {
+        if let Some(paddr) = H::alloc_frame() {
+            let ptr = H::phys_to_virt(paddr).as_mut_ptr();
+            unsafe { core::ptr::write_bytes(ptr, 0, PAGE_SIZE_4K) };
+            Ok(paddr)
+        } else {
+            Err(PagingError::NoMemory)
+        }
+    }
+
+    fn table_of<'a>(&self, paddr: PhysAddr) -> &'a [PTE] {
+        let ptr = H::phys_to_virt(paddr).as_ptr() as _;
+        unsafe { core::slice::from_raw_parts(ptr, ENTRY_COUNT) }
+    }
+
+    fn table_of_mut<'a>(&self, paddr: PhysAddr) -> &'a mut [PTE] {
+        let ptr = H::phys_to_virt(paddr).as_mut_ptr() as _;
+        unsafe { core::slice::from_raw_parts_mut(ptr, ENTRY_COUNT) }
+    }
+
+    fn next_table_mut<'a>(&self, entry: &PTE) -> PagingResult<&'a mut [PTE]> {
+        if !entry.is_present() {
+            Err(PagingError::NotMapped)
+        } else if entry.is_huge() {
+            Err(PagingError::MappedToHugePage)
+        } else {
+            Ok(self.table_of_mut(entry.paddr()))
+        }
+    }
+
+    fn next_table_mut_or_create<'a>(&mut self, entry: &mut PTE) -> PagingResult<&'a mut [PTE]> {
+        if entry.is_unused() {
+            let paddr = Self::alloc_table()?;
+            self.intrm_tables.push(paddr);
+            *entry = GenericPTE::new_table(paddr);
+            Ok(self.table_of_mut(paddr))
+        } else {
+            self.next_table_mut(entry)
+        }
+    }
+
+    fn get_entry_mut(&self, vaddr: VirtAddr) -> PagingResult<(&mut PTE, PageSize)> {
+        let p3 = if M::LEVELS == 3 {
+            self.table_of_mut(self.root_paddr())
+        } else if M::LEVELS == 4 {
+            let p4 = self.table_of_mut(self.root_paddr());
+            let p4e = &mut p4[p4_index(vaddr)];
+            self.next_table_mut(p4e)?
+        } else {
+            unreachable!()
+        };
+        let p3e = &mut p3[p3_index(vaddr)];
+        if p3e.is_huge() {
+            return Ok((p3e, PageSize::Size1G));
+        }
+
+        let p2 = self.next_table_mut(p3e)?;
+        let p2e = &mut p2[p2_index(vaddr)];
+        if p2e.is_huge() {
+            return Ok((p2e, PageSize::Size2M));
+        }
+
+        let p1 = self.next_table_mut(p2e)?;
+        let p1e = &mut p1[p1_index(vaddr)];
+        Ok((p1e, PageSize::Size4K))
+    }
+
+    fn get_entry_mut_or_create(
+        &mut self,
+        vaddr: VirtAddr,
+        page_size: PageSize,
+    ) -> PagingResult<&mut PTE> {
+        let p3 = if M::LEVELS == 3 {
+            self.table_of_mut(self.root_paddr())
+        } else if M::LEVELS == 4 {
+            let p4 = self.table_of_mut(self.root_paddr());
+            let p4e = &mut p4[p4_index(vaddr)];
+            self.next_table_mut_or_create(p4e)?
+        } else {
+            unreachable!()
+        };
+        let p3e = &mut p3[p3_index(vaddr)];
+        if page_size == PageSize::Size1G {
+            return Ok(p3e);
+        }
+
+        let p2 = self.next_table_mut_or_create(p3e)?;
+        let p2e = &mut p2[p2_index(vaddr)];
+        if page_size == PageSize::Size2M {
+            return Ok(p2e);
+        }
+
+        let p1 = self.next_table_mut_or_create(p2e)?;
+        let p1e = &mut p1[p1_index(vaddr)];
+        Ok(p1e)
+    }
+
+    fn walk_recursive<F>(
+        &self,
+        table: &[PTE],
+        level: usize,
+        start_vaddr: VirtAddr,
+        limit: usize,
+        func: &F,
+    ) -> PagingResult
+    where
+        F: Fn(usize, usize, VirtAddr, &PTE),
+    {
+        let mut n = 0;
+        for (i, entry) in table.iter().enumerate() {
+            let vaddr = start_vaddr + (i << (12 + (M::LEVELS - 1 - level) * 9));
+            if entry.is_present() {
+                func(level, i, vaddr, entry);
+                if level < M::LEVELS - 1 && !entry.is_huge() {
+                    let table_entry = self.next_table_mut(entry)?;
+                    self.walk_recursive(table_entry, level + 1, vaddr, limit, func)?;
+                }
+                n += 1;
+                if n >= limit {
+                    break;
+                }
+            }
+        }
+        Ok(())
+    }
+}
+
+impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> Drop for PageTable64<M, PTE, H> {
+    fn drop(&mut self) {
+        for frame in &self.intrm_tables {
+            H::dealloc_frame(*frame);
+        }
+    }
+}
+
\ No newline at end of file diff --git a/src/page_table_multiarch/lib.rs.html b/src/page_table_multiarch/lib.rs.html new file mode 100644 index 0000000..afbcbe0 --- /dev/null +++ b/src/page_table_multiarch/lib.rs.html @@ -0,0 +1,209 @@ +lib.rs - source
1
+2
+3
+4
+5
+6
+7
+8
+9
+10
+11
+12
+13
+14
+15
+16
+17
+18
+19
+20
+21
+22
+23
+24
+25
+26
+27
+28
+29
+30
+31
+32
+33
+34
+35
+36
+37
+38
+39
+40
+41
+42
+43
+44
+45
+46
+47
+48
+49
+50
+51
+52
+53
+54
+55
+56
+57
+58
+59
+60
+61
+62
+63
+64
+65
+66
+67
+68
+69
+70
+71
+72
+73
+74
+75
+76
+77
+78
+79
+80
+81
+82
+83
+84
+85
+86
+87
+88
+89
+90
+91
+92
+93
+94
+95
+96
+97
+98
+99
+100
+101
+102
+103
+104
+
#![cfg_attr(not(test), no_std)]
+#![feature(const_trait_impl)]
+#![feature(doc_auto_cfg)]
+#![doc = include_str!("../README.md")]
+
+#[macro_use]
+extern crate log;
+
+mod arch;
+mod bits64;
+
+use memory_addr::{PhysAddr, VirtAddr};
+
+pub use self::arch::*;
+pub use self::bits64::PageTable64;
+
+#[doc(no_inline)]
+pub use page_table_entry::{GenericPTE, MappingFlags};
+
+/// The error type for page table operation failures.
+#[derive(Debug, PartialEq)]
+pub enum PagingError {
+    /// Cannot allocate memory.
+    NoMemory,
+    /// The address is not aligned to the page size.
+    NotAligned,
+    /// The mapping is not present.
+    NotMapped,
+    /// The mapping is already present.
+    AlreadyMapped,
+    /// The page table entry represents a huge page, but the target physical
+    /// frame is 4K in size.
+    MappedToHugePage,
+}
+
+/// The specialized `Result` type for page table operations.
+pub type PagingResult<T = ()> = Result<T, PagingError>;
+
+/// The **architecture-dependent** metadata that must be provided for
+/// [`PageTable64`].
+pub trait PagingMetaData: Sync + Send + Sized {
+    /// The number of levels of the hardware page table.
+    const LEVELS: usize;
+    /// The maximum number of bits of physical address.
+    const PA_MAX_BITS: usize;
+    /// The maximum number of bits of virtual address.
+    const VA_MAX_BITS: usize;
+
+    /// The maximum physical address.
+    const PA_MAX_ADDR: usize = (1 << Self::PA_MAX_BITS) - 1;
+
+    /// Whether a given physical address is valid.
+    #[inline]
+    fn paddr_is_valid(paddr: usize) -> bool {
+        paddr <= Self::PA_MAX_ADDR // default
+    }
+
+    /// Whether a given virtual address is valid.
+    #[inline]
+    fn vaddr_is_valid(vaddr: usize) -> bool {
+        // default: top bits sign extended
+        let top_mask = usize::MAX << (Self::VA_MAX_BITS - 1);
+        (vaddr & top_mask) == 0 || (vaddr & top_mask) == top_mask
+    }
+}
+
+/// The low-level **OS-dependent** helpers that must be provided for
+/// [`PageTable64`].
+pub trait PagingHandler: Sized {
+    /// Request to allocate a 4K-sized physical frame.
+    fn alloc_frame() -> Option<PhysAddr>;
+    /// Request to free a allocated physical frame.
+    fn dealloc_frame(paddr: PhysAddr);
+    /// Returns a virtual address that maps to the given physical address.
+    ///
+    /// Used to access the physical memory directly in page table implementation.
+    fn phys_to_virt(paddr: PhysAddr) -> VirtAddr;
+}
+
+/// The page sizes supported by the hardware page table.
+#[repr(usize)]
+#[derive(Debug, Copy, Clone, Eq, PartialEq)]
+pub enum PageSize {
+    /// Size of 4 kilobytes (2<sup>12</sup> bytes).
+    Size4K = 0x1000,
+    /// Size of 2 megabytes (2<sup>21</sup> bytes).
+    Size2M = 0x20_0000,
+    /// Size of 1 gigabytes (2<sup>30</sup> bytes).
+    Size1G = 0x4000_0000,
+}
+
+impl PageSize {
+    /// Whether this page size is considered huge (larger than 4K).
+    pub const fn is_huge(self) -> bool {
+        matches!(self, Self::Size1G | Self::Size2M)
+    }
+}
+
+impl From<PageSize> for usize {
+    #[inline]
+    fn from(size: PageSize) -> usize {
+        size as usize
+    }
+}
+
\ No newline at end of file diff --git a/static.files/COPYRIGHT-23e9bde6c69aea69.txt b/static.files/COPYRIGHT-23e9bde6c69aea69.txt new file mode 100644 index 0000000..1447df7 --- /dev/null +++ b/static.files/COPYRIGHT-23e9bde6c69aea69.txt @@ -0,0 +1,50 @@ +# REUSE-IgnoreStart + +These documentation pages include resources by third parties. This copyright +file applies only to those resources. The following third party resources are +included, and carry their own copyright notices and license terms: + +* Fira Sans (FiraSans-Regular.woff2, FiraSans-Medium.woff2): + + Copyright (c) 2014, Mozilla Foundation https://mozilla.org/ + with Reserved Font Name Fira Sans. + + Copyright (c) 2014, Telefonica S.A. + + Licensed under the SIL Open Font License, Version 1.1. + See FiraSans-LICENSE.txt. + +* rustdoc.css, main.js, and playpen.js: + + Copyright 2015 The Rust Developers. + Licensed under the Apache License, Version 2.0 (see LICENSE-APACHE.txt) or + the MIT license (LICENSE-MIT.txt) at your option. + +* normalize.css: + + Copyright (c) Nicolas Gallagher and Jonathan Neal. + Licensed under the MIT license (see LICENSE-MIT.txt). + +* Source Code Pro (SourceCodePro-Regular.ttf.woff2, + SourceCodePro-Semibold.ttf.woff2, SourceCodePro-It.ttf.woff2): + + Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), + with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark + of Adobe Systems Incorporated in the United States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceCodePro-LICENSE.txt. + +* Source Serif 4 (SourceSerif4-Regular.ttf.woff2, SourceSerif4-Bold.ttf.woff2, + SourceSerif4-It.ttf.woff2): + + Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name + 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United + States and/or other countries. + + Licensed under the SIL Open Font License, Version 1.1. + See SourceSerif4-LICENSE.md. + +This copyright file is intended to be distributed with rustdoc output. + +# REUSE-IgnoreEnd diff --git a/static.files/FiraSans-LICENSE-db4b642586e02d97.txt b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt new file mode 100644 index 0000000..d7e9c14 --- /dev/null +++ b/static.files/FiraSans-LICENSE-db4b642586e02d97.txt @@ -0,0 +1,98 @@ +// REUSE-IgnoreStart + +Digitized data copyright (c) 2012-2015, The Mozilla Foundation and Telefonica S.A. +with Reserved Font Name < Fira >, + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 new file mode 100644 index 0000000..7a1e5fc Binary files /dev/null and b/static.files/FiraSans-Medium-8f9a781e4970d388.woff2 differ diff --git a/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 new file mode 100644 index 0000000..e766e06 Binary files /dev/null and b/static.files/FiraSans-Regular-018c141bf0843ffd.woff2 differ diff --git a/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt new file mode 100644 index 0000000..16fe87b --- /dev/null +++ b/static.files/LICENSE-APACHE-b91fa81cba47b86a.txt @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + +TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + +1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + +2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + +3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + +4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + +5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + +6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + +7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + +8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + +9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + +END OF TERMS AND CONDITIONS + +APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + +Copyright [yyyy] [name of copyright owner] + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. diff --git a/static.files/LICENSE-MIT-65090b722b3f6c56.txt b/static.files/LICENSE-MIT-65090b722b3f6c56.txt new file mode 100644 index 0000000..31aa793 --- /dev/null +++ b/static.files/LICENSE-MIT-65090b722b3f6c56.txt @@ -0,0 +1,23 @@ +Permission is hereby granted, free of charge, to any +person obtaining a copy of this software and associated +documentation files (the "Software"), to deal in the +Software without restriction, including without +limitation the rights to use, copy, modify, merge, +publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software +is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice +shall be included in all copies or substantial portions +of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED +TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A +PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT +SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION +OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR +IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +DEALINGS IN THE SOFTWARE. diff --git a/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 new file mode 100644 index 0000000..1866ad4 Binary files /dev/null and b/static.files/NanumBarunGothic-0f09457c7a19b7c6.ttf.woff2 differ diff --git a/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt new file mode 100644 index 0000000..4b3edc2 --- /dev/null +++ b/static.files/NanumBarunGothic-LICENSE-18c5adf4b52b4041.txt @@ -0,0 +1,103 @@ +// REUSE-IgnoreStart + +Copyright (c) 2010, NAVER Corporation (https://www.navercorp.com/), + +with Reserved Font Name Nanum, Naver Nanum, NanumGothic, Naver NanumGothic, +NanumMyeongjo, Naver NanumMyeongjo, NanumBrush, Naver NanumBrush, NanumPen, +Naver NanumPen, Naver NanumGothicEco, NanumGothicEco, Naver NanumMyeongjoEco, +NanumMyeongjoEco, Naver NanumGothicLight, NanumGothicLight, NanumBarunGothic, +Naver NanumBarunGothic, NanumSquareRound, NanumBarunPen, MaruBuri + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 new file mode 100644 index 0000000..462c34e Binary files /dev/null and b/static.files/SourceCodePro-It-1cc31594bf4f1f79.ttf.woff2 differ diff --git a/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt new file mode 100644 index 0000000..0d2941e --- /dev/null +++ b/static.files/SourceCodePro-LICENSE-d180d465a756484a.txt @@ -0,0 +1,97 @@ +// REUSE-IgnoreStart + +Copyright 2010, 2012 Adobe Systems Incorporated (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe Systems Incorporated in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + +// REUSE-IgnoreEnd diff --git a/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 new file mode 100644 index 0000000..10b558e Binary files /dev/null and b/static.files/SourceCodePro-Regular-562dcc5011b6de7d.ttf.woff2 differ diff --git a/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 new file mode 100644 index 0000000..5ec64ee Binary files /dev/null and b/static.files/SourceCodePro-Semibold-d899c5a5c4aeb14a.ttf.woff2 differ diff --git a/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 new file mode 100644 index 0000000..181a07f Binary files /dev/null and b/static.files/SourceSerif4-Bold-a2c9cd1067f8b328.ttf.woff2 differ diff --git a/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 new file mode 100644 index 0000000..2ae08a7 Binary files /dev/null and b/static.files/SourceSerif4-It-acdfaf1a8af734b1.ttf.woff2 differ diff --git a/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md new file mode 100644 index 0000000..175fa4f --- /dev/null +++ b/static.files/SourceSerif4-LICENSE-3bb119e13b1258b7.md @@ -0,0 +1,98 @@ + + +Copyright 2014-2021 Adobe (http://www.adobe.com/), with Reserved Font Name 'Source'. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. +Copyright 2014 - 2023 Adobe (http://www.adobe.com/), with Reserved Font Name ‘Source’. All Rights Reserved. Source is a trademark of Adobe in the United States and/or other countries. + +This Font Software is licensed under the SIL Open Font License, Version 1.1. + +This license is copied below, and is also available with a FAQ at: http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. + + diff --git a/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 new file mode 100644 index 0000000..0263fc3 Binary files /dev/null and b/static.files/SourceSerif4-Regular-46f98efaafac5295.ttf.woff2 differ diff --git a/static.files/favicon-2c020d218678b618.svg b/static.files/favicon-2c020d218678b618.svg new file mode 100644 index 0000000..8b34b51 --- /dev/null +++ b/static.files/favicon-2c020d218678b618.svg @@ -0,0 +1,24 @@ + + + + + diff --git a/static.files/favicon-32x32-422f7d1d52889060.png b/static.files/favicon-32x32-422f7d1d52889060.png new file mode 100644 index 0000000..69b8613 Binary files /dev/null and b/static.files/favicon-32x32-422f7d1d52889060.png differ diff --git a/static.files/main-20a3ad099b048cf2.js b/static.files/main-20a3ad099b048cf2.js new file mode 100644 index 0000000..133116e --- /dev/null +++ b/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/static.files/normalize-76eba96aa4d2e634.css b/static.files/normalize-76eba96aa4d2e634.css new file mode 100644 index 0000000..469959f --- /dev/null +++ b/static.files/normalize-76eba96aa4d2e634.css @@ -0,0 +1,2 @@ + /*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */ +html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:0.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type="button"],[type="reset"],[type="submit"],button{-webkit-appearance:button}[type="button"]::-moz-focus-inner,[type="reset"]::-moz-focus-inner,[type="submit"]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type="button"]:-moz-focusring,[type="reset"]:-moz-focusring,[type="submit"]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:0.35em 0.75em 0.625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type="checkbox"],[type="radio"]{box-sizing:border-box;padding:0}[type="number"]::-webkit-inner-spin-button,[type="number"]::-webkit-outer-spin-button{height:auto}[type="search"]{-webkit-appearance:textfield;outline-offset:-2px}[type="search"]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none} \ No newline at end of file diff --git a/static.files/noscript-df360f571f6edeae.css b/static.files/noscript-df360f571f6edeae.css new file mode 100644 index 0000000..4c310ae --- /dev/null +++ b/static.files/noscript-df360f571f6edeae.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;--settings-menu-filter:none;--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/static.files/rust-logo-151179464ae7ed46.svg b/static.files/rust-logo-151179464ae7ed46.svg new file mode 100644 index 0000000..62424d8 --- /dev/null +++ b/static.files/rust-logo-151179464ae7ed46.svg @@ -0,0 +1,61 @@ + + + diff --git a/static.files/rustdoc-dd39b87e5fcfba68.css b/static.files/rustdoc-dd39b87e5fcfba68.css new file mode 100644 index 0000000..77f8983 --- /dev/null +++ b/static.files/rustdoc-dd39b87e5fcfba68.css @@ -0,0 +1,46 @@ + :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.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);}#settings-menu>a{line-height:0;font-size:0;}#settings-menu>a:before{content:url('data:image/svg+xml,\ + ');width:22px;height:22px;filter:var(--settings-menu-filter);}#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;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.toggle[open] >summary::after{content:"Collapse";}.docblock summary>*{display:inline-block;}.docblock>.example-wrap:first-child .tooltip{margin-top:16px;}.src #sidebar-button>a:before,.sidebar-menu-toggle:before{content:url('data:image/svg+xml,\ + ');opacity:0.75;}.sidebar-menu-toggle:hover:before,.sidebar-menu-toggle:active:before,.sidebar-menu-toggle:focus:before{opacity:1;}.src #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"],: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;--settings-menu-filter:none;--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;--settings-menu-filter:none;--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;--settings-menu-filter:invert(100%);--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/static.files/scrape-examples-ef1e698c1d417c0c.js b/static.files/scrape-examples-ef1e698c1d417c0c.js new file mode 100644 index 0000000..ba830e3 --- /dev/null +++ b/static.files/scrape-examples-ef1e698c1d417c0c.js @@ -0,0 +1 @@ +"use strict";(function(){const DEFAULT_MAX_LINES=5;const HIDDEN_MAX_LINES=10;function scrollToLoc(elt,loc,isHidden){const lines=elt.querySelector(".src-line-numbers");let scrollOffset;const maxLines=isHidden?HIDDEN_MAX_LINES:DEFAULT_MAX_LINES;if(loc[1]-loc[0]>maxLines){const line=Math.max(0,loc[0]-1);scrollOffset=lines.children[line].offsetTop}else{const wrapper=elt.querySelector(".code-wrapper");const halfHeight=wrapper.offsetHeight/2;const offsetTop=lines.children[loc[0]].offsetTop;const lastLine=lines.children[loc[1]];const offsetBot=lastLine.offsetTop+lastLine.offsetHeight;const offsetMid=(offsetTop+offsetBot)/2;scrollOffset=offsetMid-halfHeight}lines.scrollTo(0,scrollOffset);elt.querySelector(".rust").scrollTo(0,scrollOffset)}function updateScrapedExample(example,isHidden){const locs=JSON.parse(example.attributes.getNamedItem("data-locs").textContent);let locIndex=0;const highlights=Array.prototype.slice.call(example.querySelectorAll(".highlight"));const link=example.querySelector(".scraped-example-title a");if(locs.length>1){const onChangeLoc=changeIndex=>{removeClass(highlights[locIndex],"focus");changeIndex();scrollToLoc(example,locs[locIndex][0],isHidden);addClass(highlights[locIndex],"focus");const url=locs[locIndex][1];const title=locs[locIndex][2];link.href=url;link.innerHTML=title};example.querySelector(".prev").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex-1+locs.length)%locs.length})});example.querySelector(".next").addEventListener("click",()=>{onChangeLoc(()=>{locIndex=(locIndex+1)%locs.length})})}const expandButton=example.querySelector(".expand");if(expandButton){expandButton.addEventListener("click",()=>{if(hasClass(example,"expanded")){removeClass(example,"expanded");scrollToLoc(example,locs[0][0],isHidden)}else{addClass(example,"expanded")}})}scrollToLoc(example,locs[0][0],isHidden)}const firstExamples=document.querySelectorAll(".scraped-example-list > .scraped-example");onEachLazy(firstExamples,el=>updateScrapedExample(el,false));onEachLazy(document.querySelectorAll(".more-examples-toggle"),toggle=>{onEachLazy(toggle.querySelectorAll(".toggle-line, .hide-more"),button=>{button.addEventListener("click",()=>{toggle.open=false})});const moreExamples=toggle.querySelectorAll(".scraped-example");toggle.querySelector("summary").addEventListener("click",()=>{setTimeout(()=>{onEachLazy(moreExamples,el=>updateScrapedExample(el,true))})},{once:true})})})() \ No newline at end of file diff --git a/static.files/search-d234aafac6c221dd.js b/static.files/search-d234aafac6c221dd.js new file mode 100644 index 0000000..3f587f6 --- /dev/null +++ b/static.files/search-d234aafac6c221dd.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;const REGEX_IDENT=/\p{ID_Start}\p{ID_Continue}*|_\p{ID_Continue}+/uy;const REGEX_INVALID_TYPE_FILTER=/[^a-z]/ui;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 consumeIdent(parserState){REGEX_IDENT.lastIndex=parserState.pos;const match=parserState.userQuery.match(REGEX_IDENT);if(match){parserState.pos+=match[0].length;return true}return false}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){let afterIdent=consumeIdent(parserState);let end=parserState.pos;let macroExclamation=-1;while(parserState.pos0){throw["Unexpected ",c," after ",parserState.userQuery[parserState.pos-1]," (not a valid identifier)"]}else{throw["Unexpected ",c," (not a valid identifier)"]}parserState.pos+=1;afterIdent=consumeIdent(parserState);end=parserState.pos}if(macroExclamation!==-1){if(parserState.typeFilter===null){parserState.typeFilter="macro"}else if(parserState.typeFilter!=="macro"){throw["Invalid search type: macro ","!"," and ",parserState.typeFilter," both specified",]}end=macroExclamation}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 if(parserState.userQuery[parserState.pos]==="&"){if(parserState.typeFilter!==null&&parserState.typeFilter!=="primitive"){throw["Invalid search type: primitive ","&"," and ",parserState.typeFilter," both specified",]}parserState.typeFilter=null;parserState.pos+=1;let c=parserState.userQuery[parserState.pos];while(c===" "&&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();const match=query.match(REGEX_INVALID_TYPE_FILTER);if(match){throw["Unexpected ",match[0]," 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,}}async 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{return searchIndexEmptyDesc.get(alias.crate).contains(alias.bitIndex)?"":searchState.loadDesc(alias)};const[crateDescs,descs]=await Promise.all([Promise.all(crateAliases.map(fetchDesc)),Promise.all(aliases.map(fetchDesc)),]);const pushFunc=alias=>{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((alias,i)=>{alias.desc=descs[i]});aliases.forEach(pushFunc);crateAliases.forEach((alias,i)=>{alias.desc=crateDescs[i]});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){const loweredName=elem.pathLast.toLowerCase();if(typeNameIdMap.has(loweredName)&&(isAssocType||!typeNameIdMap.get(loweredName).assocOnly)){elem.id=typeNameIdMap.get(loweredName).id}else if(!parsedQuery.literalSearch){let match=null;let matchDist=maxEditDistance+1;let matchName="";for(const[name,{id,assocOnly}]of typeNameIdMap){const dist=Math.min(editDistance(name,loweredName,maxEditDistance),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(){let c=this.string.charCodeAt(this.offset);const ret=[];while(c!==125){ret.push(this.decode());c=this.string.charCodeAt(this.offset)}this.offset+=1;return ret}decode(){let n=0;let c=this.string.charCodeAt(this.offset);if(c===123){this.offset+=1;return this.decodeList()}while(c<96){n=(n<<4)|(c&0xF);this.offset+=1;c=this.string.charCodeAt(this.offset)}n=(n<<4)|(c&0xF);const[sign,value]=[n&1,n>>1];this.offset+=1;return sign?-value:value}next(){const c=this.string.charCodeAt(this.offset);if(c>=48&&c<64){this.offset+=1;return this.backrefQueue[c-48]}if(c===96){this.offset+=1;return this.cons(0)}const result=this.cons(this.decode());this.backrefQueue.unshift(result);if(this.backrefQueue.length>16){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();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)-65,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/static.files/settings-4313503d2e1961c2.js b/static.files/settings-4313503d2e1961c2.js new file mode 100644 index 0000000..ab425fe --- /dev/null +++ b/static.files/settings-4313503d2e1961c2.js @@ -0,0 +1,17 @@ +"use strict";(function(){const isSettingsPage=window.location.pathname.endsWith("/settings.html");function changeSetting(settingName,value){if(settingName==="theme"){const useSystem=value==="system preference"?"true":"false";updateLocalStorage("use-system-theme",useSystem)}updateLocalStorage(settingName,value);switch(settingName){case"theme":case"preferred-dark-theme":case"preferred-light-theme":updateTheme();updateLightAndDark();break;case"line-numbers":if(value===true){window.rustdoc_add_line_numbers_to_examples()}else{window.rustdoc_remove_line_numbers_from_examples()}break;case"hide-sidebar":if(value===true){addClass(document.documentElement,"hide-sidebar")}else{removeClass(document.documentElement,"hide-sidebar")}break}}function showLightAndDark(){removeClass(document.getElementById("preferred-light-theme"),"hidden");removeClass(document.getElementById("preferred-dark-theme"),"hidden")}function hideLightAndDark(){addClass(document.getElementById("preferred-light-theme"),"hidden");addClass(document.getElementById("preferred-dark-theme"),"hidden")}function updateLightAndDark(){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||(useSystem===null&&getSettingValue("theme")===null)){showLightAndDark()}else{hideLightAndDark()}}function setEvents(settingsElement){updateLightAndDark();onEachLazy(settingsElement.querySelectorAll("input[type=\"checkbox\"]"),toggle=>{const settingId=toggle.id;const settingValue=getSettingValue(settingId);if(settingValue!==null){toggle.checked=settingValue==="true"}toggle.onchange=()=>{changeSetting(toggle.id,toggle.checked)}});onEachLazy(settingsElement.querySelectorAll("input[type=\"radio\"]"),elem=>{const settingId=elem.name;let settingValue=getSettingValue(settingId);if(settingId==="theme"){const useSystem=getSettingValue("use-system-theme");if(useSystem==="true"||settingValue===null){settingValue=useSystem==="false"?"light":"system preference"}}if(settingValue!==null&&settingValue!=="null"){elem.checked=settingValue===elem.value}elem.addEventListener("change",ev=>{changeSetting(ev.target.name,ev.target.value)})})}function buildSettingsPageSections(settings){let output="";for(const setting of settings){const js_data_name=setting["js_name"];const setting_name=setting["name"];if(setting["options"]!==undefined){output+=`\ +
+
${setting_name}
+
`;onEach(setting["options"],option=>{const checked=option===setting["default"]?" checked":"";const full=`${js_data_name}-${option.replace(/ /g,"-")}`;output+=`\ + `});output+=`\ +
+
`}else{const checked=setting["default"]===true?" checked":"";output+=`\ +
\ + \ +
`}}return output}function buildSettingsPage(){const theme_names=getVar("themes").split(",").filter(t=>t);theme_names.push("light","dark","ayu");const settings=[{"name":"Theme","js_name":"theme","default":"system preference","options":theme_names.concat("system preference"),},{"name":"Preferred light theme","js_name":"preferred-light-theme","default":"light","options":theme_names,},{"name":"Preferred dark theme","js_name":"preferred-dark-theme","default":"dark","options":theme_names,},{"name":"Auto-hide item contents for large items","js_name":"auto-hide-large-items","default":true,},{"name":"Auto-hide item methods' documentation","js_name":"auto-hide-method-docs","default":false,},{"name":"Auto-hide trait implementation documentation","js_name":"auto-hide-trait-implementations","default":false,},{"name":"Directly go to item in search if there is only one result","js_name":"go-to-only-result","default":false,},{"name":"Show line numbers on code examples","js_name":"line-numbers","default":false,},{"name":"Hide persistent navigation bar","js_name":"hide-sidebar","default":false,},{"name":"Disable keyboard shortcuts","js_name":"disable-shortcuts","default":false,},];const elementKind=isSettingsPage?"section":"div";const innerHTML=`
${buildSettingsPageSections(settings)}
`;const el=document.createElement(elementKind);el.id="settings";if(!isSettingsPage){el.className="popover"}el.innerHTML=innerHTML;if(isSettingsPage){document.getElementById(MAIN_ID).appendChild(el)}else{el.setAttribute("tabindex","-1");getSettingsButton().appendChild(el)}return el}const settingsMenu=buildSettingsPage();function displaySettings(){settingsMenu.style.display="";onEachLazy(settingsMenu.querySelectorAll("input[type='checkbox']"),el=>{const val=getSettingValue(el.id);const checked=val==="true";if(checked!==el.checked&&val!==null){el.checked=checked}})}function settingsBlurHandler(event){blurHandler(event,getSettingsButton(),window.hidePopoverMenus)}if(isSettingsPage){getSettingsButton().onclick=event=>{event.preventDefault()}}else{const settingsButton=getSettingsButton();const settingsMenu=document.getElementById("settings");settingsButton.onclick=event=>{if(settingsMenu.contains(event.target)){return}event.preventDefault();const shouldDisplaySettings=settingsMenu.style.display==="none";window.hideAllModals();if(shouldDisplaySettings){displaySettings()}};settingsButton.onblur=settingsBlurHandler;settingsButton.querySelector("a").onblur=settingsBlurHandler;onEachLazy(settingsMenu.querySelectorAll("input"),el=>{el.onblur=settingsBlurHandler});settingsMenu.onblur=settingsBlurHandler}setTimeout(()=>{setEvents(settingsMenu);if(!isSettingsPage){displaySettings()}removeClass(getSettingsButton(),"rotate")},0)})() \ No newline at end of file diff --git a/static.files/src-script-e66d777a5a92e9b2.js b/static.files/src-script-e66d777a5a92e9b2.js new file mode 100644 index 0000000..d0aebb8 --- /dev/null +++ b/static.files/src-script-e66d777a5a92e9b2.js @@ -0,0 +1 @@ +"use strict";(function(){const rootPath=getVar("root-path");const NAME_OFFSET=0;const DIRS_OFFSET=1;const FILES_OFFSET=2;const RUSTDOC_MOBILE_BREAKPOINT=700;function closeSidebarIfMobile(){if(window.innerWidth{removeClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","false")};window.rustdocShowSourceSidebar=()=>{addClass(document.documentElement,"src-sidebar-expanded");updateLocalStorage("source-sidebar-show","true")};window.rustdocToggleSrcSidebar=()=>{if(document.documentElement.classList.contains("src-sidebar-expanded")){window.rustdocCloseSourceSidebar()}else{window.rustdocShowSourceSidebar()}};function createSrcSidebar(){const container=document.querySelector("nav.sidebar");const sidebar=document.createElement("div");sidebar.id="src-sidebar";let hasFoundFile=false;for(const[key,source]of srcIndex){source[NAME_OFFSET]=key;hasFoundFile=createDirEntry(source,sidebar,"",hasFoundFile)}container.appendChild(sidebar);const selected_elem=sidebar.getElementsByClassName("selected")[0];if(typeof selected_elem!=="undefined"){selected_elem.focus()}}function highlightSrcLines(){const match=window.location.hash.match(/^#?(\d+)(?:-(\d+))?$/);if(!match){return}let from=parseInt(match[1],10);let to=from;if(typeof match[2]!=="undefined"){to=parseInt(match[2],10)}if(to{onEachLazy(e.getElementsByTagName("a"),i_e=>{removeClass(i_e,"line-highlighted")})});for(let i=from;i<=to;++i){elem=document.getElementById(i);if(!elem){break}addClass(elem,"line-highlighted")}}const handleSrcHighlight=(function(){let prev_line_id=0;const set_fragment=name=>{const x=window.scrollX,y=window.scrollY;if(browserSupportsHistoryApi()){history.replaceState(null,null,"#"+name);highlightSrcLines()}else{location.replace("#"+name)}window.scrollTo(x,y)};return ev=>{let cur_line_id=parseInt(ev.target.id,10);if(isNaN(cur_line_id)||ev.ctrlKey||ev.altKey||ev.metaKey){return}ev.preventDefault();if(ev.shiftKey&&prev_line_id){if(prev_line_id>cur_line_id){const tmp=prev_line_id;prev_line_id=cur_line_id;cur_line_id=tmp}set_fragment(prev_line_id+"-"+cur_line_id)}else{prev_line_id=cur_line_id;set_fragment(cur_line_id)}}}());window.addEventListener("hashchange",highlightSrcLines);onEachLazy(document.getElementsByClassName("src-line-numbers"),el=>{el.addEventListener("click",handleSrcHighlight)});highlightSrcLines();window.createSrcSidebar=createSrcSidebar})() \ No newline at end of file diff --git a/static.files/storage-118b08c4c78b968e.js b/static.files/storage-118b08c4c78b968e.js new file mode 100644 index 0000000..9818946 --- /dev/null +++ b/static.files/storage-118b08c4c78b968e.js @@ -0,0 +1,24 @@ +"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)}});class RustdocSearchElement extends HTMLElement{constructor(){super()}connectedCallback(){const rootPath=getVar("root-path");const currentCrate=getVar("current-crate");this.innerHTML=``}}window.customElements.define("rustdoc-search",RustdocSearchElement) \ No newline at end of file diff --git a/trait.impl/bitflags/traits/trait.Flags.js b/trait.impl/bitflags/traits/trait.Flags.js new file mode 100644 index 0000000..887d896 --- /dev/null +++ b/trait.impl/bitflags/traits/trait.Flags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl Flags for DescriptorAttr"],["impl Flags for PTEFlags"],["impl Flags for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/bitflags/traits/trait.PublicFlags.js b/trait.impl/bitflags/traits/trait.PublicFlags.js new file mode 100644 index 0000000..40b006c --- /dev/null +++ b/trait.impl/bitflags/traits/trait.PublicFlags.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl PublicFlags for DescriptorAttr"],["impl PublicFlags for PTEFlags"],["impl PublicFlags for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js new file mode 100644 index 0000000..c7164cd --- /dev/null +++ b/trait.impl/core/clone/trait.Clone.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Clone for MemAttr"],["impl Clone for A64PTE"],["impl Clone for Rv64PTE"],["impl Clone for MappingFlags"],["impl Clone for X64PTE"]], +"page_table_multiarch":[["impl Clone for PageSize"],["impl Clone for A64PagingMetaData"],["impl Clone for Sv39MetaData"],["impl Clone for Sv48MetaData"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Eq.js b/trait.impl/core/cmp/trait.Eq.js new file mode 100644 index 0000000..37ef4b7 --- /dev/null +++ b/trait.impl/core/cmp/trait.Eq.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Eq for MemAttr"]], +"page_table_multiarch":[["impl Eq for PageSize"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js new file mode 100644 index 0000000..885a579 --- /dev/null +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl PartialEq for MemAttr"],["impl PartialEq for MappingFlags"]], +"page_table_multiarch":[["impl PartialEq for PageSize"],["impl PartialEq for PagingError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js new file mode 100644 index 0000000..a3d9854 --- /dev/null +++ b/trait.impl/core/convert/trait.From.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl From<DescriptorAttr> for MappingFlags"],["impl From<PTEFlags> for MappingFlags"],["impl From<MappingFlags> for DescriptorAttr"],["impl From<MappingFlags> for PTEFlags"],["impl From<MappingFlags> for PTF"],["impl From<PageTableFlags> for MappingFlags"]], +"page_table_multiarch":[["impl From<PageSize> for usize"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Binary.js b/trait.impl/core/fmt/trait.Binary.js new file mode 100644 index 0000000..db24177 --- /dev/null +++ b/trait.impl/core/fmt/trait.Binary.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl Binary for DescriptorAttr"],["impl Binary for PTEFlags"],["impl Binary for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js new file mode 100644 index 0000000..ad911c9 --- /dev/null +++ b/trait.impl/core/fmt/trait.Debug.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Debug for MemAttr"],["impl Debug for A64PTE"],["impl Debug for DescriptorAttr"],["impl Debug for PTEFlags"],["impl Debug for Rv64PTE"],["impl Debug for MappingFlags"],["impl Debug for X64PTE"]], +"page_table_multiarch":[["impl Debug for PageSize"],["impl Debug for PagingError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.LowerHex.js b/trait.impl/core/fmt/trait.LowerHex.js new file mode 100644 index 0000000..c6d01a5 --- /dev/null +++ b/trait.impl/core/fmt/trait.LowerHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl LowerHex for DescriptorAttr"],["impl LowerHex for PTEFlags"],["impl LowerHex for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Octal.js b/trait.impl/core/fmt/trait.Octal.js new file mode 100644 index 0000000..939ec51 --- /dev/null +++ b/trait.impl/core/fmt/trait.Octal.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl Octal for DescriptorAttr"],["impl Octal for PTEFlags"],["impl Octal for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.UpperHex.js b/trait.impl/core/fmt/trait.UpperHex.js new file mode 100644 index 0000000..1f4458c --- /dev/null +++ b/trait.impl/core/fmt/trait.UpperHex.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl UpperHex for DescriptorAttr"],["impl UpperHex for PTEFlags"],["impl UpperHex for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.Extend.js b/trait.impl/core/iter/traits/collect/trait.Extend.js new file mode 100644 index 0000000..be62c78 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.Extend.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl Extend<DescriptorAttr> for DescriptorAttr"],["impl Extend<PTEFlags> for PTEFlags"],["impl Extend<MappingFlags> for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.FromIterator.js b/trait.impl/core/iter/traits/collect/trait.FromIterator.js new file mode 100644 index 0000000..a26b5a1 --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.FromIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl FromIterator<DescriptorAttr> for DescriptorAttr"],["impl FromIterator<PTEFlags> for PTEFlags"],["impl FromIterator<MappingFlags> for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/iter/traits/collect/trait.IntoIterator.js b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js new file mode 100644 index 0000000..2ce16de --- /dev/null +++ b/trait.impl/core/iter/traits/collect/trait.IntoIterator.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl IntoIterator for DescriptorAttr"],["impl IntoIterator for PTEFlags"],["impl IntoIterator for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js new file mode 100644 index 0000000..9c323bd --- /dev/null +++ b/trait.impl/core/marker/trait.Copy.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Copy for MemAttr"],["impl Copy for A64PTE"],["impl Copy for Rv64PTE"],["impl Copy for MappingFlags"],["impl Copy for X64PTE"]], +"page_table_multiarch":[["impl Copy for PageSize"],["impl Copy for A64PagingMetaData"],["impl Copy for Sv39MetaData"],["impl Copy for Sv48MetaData"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js new file mode 100644 index 0000000..4b6abc4 --- /dev/null +++ b/trait.impl/core/marker/trait.Freeze.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Freeze for MemAttr",1,["page_table_entry::arch::aarch64::MemAttr"]],["impl Freeze for A64PTE",1,["page_table_entry::arch::aarch64::A64PTE"]],["impl Freeze for DescriptorAttr",1,["page_table_entry::arch::aarch64::DescriptorAttr"]],["impl Freeze for PTEFlags",1,["page_table_entry::arch::riscv::PTEFlags"]],["impl Freeze for Rv64PTE",1,["page_table_entry::arch::riscv::Rv64PTE"]],["impl Freeze for MappingFlags",1,["page_table_entry::MappingFlags"]],["impl Freeze for X64PTE",1,["page_table_entry::arch::x86_64::X64PTE"]]], +"page_table_multiarch":[["impl Freeze for PageSize",1,["page_table_multiarch::PageSize"]],["impl Freeze for PagingError",1,["page_table_multiarch::PagingError"]],["impl Freeze for A64PagingMetaData",1,["page_table_multiarch::arch::aarch64::A64PagingMetaData"]],["impl Freeze for Sv39MetaData",1,["page_table_multiarch::arch::riscv::Sv39MetaData"]],["impl Freeze for Sv48MetaData",1,["page_table_multiarch::arch::riscv::Sv48MetaData"]],["impl Freeze for X64PagingMetaData",1,["page_table_multiarch::arch::x86_64::X64PagingMetaData"]],["impl<M, PTE, H> Freeze for PageTable64<M, PTE, H>",1,["page_table_multiarch::bits64::PageTable64"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js new file mode 100644 index 0000000..e4c3a73 --- /dev/null +++ b/trait.impl/core/marker/trait.Send.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Send for MemAttr",1,["page_table_entry::arch::aarch64::MemAttr"]],["impl Send for A64PTE",1,["page_table_entry::arch::aarch64::A64PTE"]],["impl Send for DescriptorAttr",1,["page_table_entry::arch::aarch64::DescriptorAttr"]],["impl Send for PTEFlags",1,["page_table_entry::arch::riscv::PTEFlags"]],["impl Send for Rv64PTE",1,["page_table_entry::arch::riscv::Rv64PTE"]],["impl Send for MappingFlags",1,["page_table_entry::MappingFlags"]],["impl Send for X64PTE",1,["page_table_entry::arch::x86_64::X64PTE"]]], +"page_table_multiarch":[["impl Send for PageSize",1,["page_table_multiarch::PageSize"]],["impl Send for PagingError",1,["page_table_multiarch::PagingError"]],["impl Send for A64PagingMetaData",1,["page_table_multiarch::arch::aarch64::A64PagingMetaData"]],["impl Send for Sv39MetaData",1,["page_table_multiarch::arch::riscv::Sv39MetaData"]],["impl Send for Sv48MetaData",1,["page_table_multiarch::arch::riscv::Sv48MetaData"]],["impl Send for X64PagingMetaData",1,["page_table_multiarch::arch::x86_64::X64PagingMetaData"]],["impl<M, PTE, H> Send for PageTable64<M, PTE, H>
where\n H: Send,
",1,["page_table_multiarch::bits64::PageTable64"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js new file mode 100644 index 0000000..aab45c0 --- /dev/null +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl StructuralPartialEq for MemAttr"],["impl StructuralPartialEq for MappingFlags"]], +"page_table_multiarch":[["impl StructuralPartialEq for PageSize"],["impl StructuralPartialEq for PagingError"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js new file mode 100644 index 0000000..9a3840c --- /dev/null +++ b/trait.impl/core/marker/trait.Sync.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Sync for MemAttr",1,["page_table_entry::arch::aarch64::MemAttr"]],["impl Sync for A64PTE",1,["page_table_entry::arch::aarch64::A64PTE"]],["impl Sync for DescriptorAttr",1,["page_table_entry::arch::aarch64::DescriptorAttr"]],["impl Sync for PTEFlags",1,["page_table_entry::arch::riscv::PTEFlags"]],["impl Sync for Rv64PTE",1,["page_table_entry::arch::riscv::Rv64PTE"]],["impl Sync for MappingFlags",1,["page_table_entry::MappingFlags"]],["impl Sync for X64PTE",1,["page_table_entry::arch::x86_64::X64PTE"]]], +"page_table_multiarch":[["impl Sync for PageSize",1,["page_table_multiarch::PageSize"]],["impl Sync for PagingError",1,["page_table_multiarch::PagingError"]],["impl Sync for A64PagingMetaData",1,["page_table_multiarch::arch::aarch64::A64PagingMetaData"]],["impl Sync for Sv39MetaData",1,["page_table_multiarch::arch::riscv::Sv39MetaData"]],["impl Sync for Sv48MetaData",1,["page_table_multiarch::arch::riscv::Sv48MetaData"]],["impl Sync for X64PagingMetaData",1,["page_table_multiarch::arch::x86_64::X64PagingMetaData"]],["impl<M, PTE, H> Sync for PageTable64<M, PTE, H>
where\n H: Sync,
",1,["page_table_multiarch::bits64::PageTable64"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js new file mode 100644 index 0000000..e139eb5 --- /dev/null +++ b/trait.impl/core/marker/trait.Unpin.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl Unpin for MemAttr",1,["page_table_entry::arch::aarch64::MemAttr"]],["impl Unpin for A64PTE",1,["page_table_entry::arch::aarch64::A64PTE"]],["impl Unpin for DescriptorAttr",1,["page_table_entry::arch::aarch64::DescriptorAttr"]],["impl Unpin for PTEFlags",1,["page_table_entry::arch::riscv::PTEFlags"]],["impl Unpin for Rv64PTE",1,["page_table_entry::arch::riscv::Rv64PTE"]],["impl Unpin for MappingFlags",1,["page_table_entry::MappingFlags"]],["impl Unpin for X64PTE",1,["page_table_entry::arch::x86_64::X64PTE"]]], +"page_table_multiarch":[["impl Unpin for PageSize",1,["page_table_multiarch::PageSize"]],["impl Unpin for PagingError",1,["page_table_multiarch::PagingError"]],["impl Unpin for A64PagingMetaData",1,["page_table_multiarch::arch::aarch64::A64PagingMetaData"]],["impl Unpin for Sv39MetaData",1,["page_table_multiarch::arch::riscv::Sv39MetaData"]],["impl Unpin for Sv48MetaData",1,["page_table_multiarch::arch::riscv::Sv48MetaData"]],["impl Unpin for X64PagingMetaData",1,["page_table_multiarch::arch::x86_64::X64PagingMetaData"]],["impl<M, PTE, H> Unpin for PageTable64<M, PTE, H>
where\n M: Unpin,\n PTE: Unpin,\n H: Unpin,
",1,["page_table_multiarch::bits64::PageTable64"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.Sub.js b/trait.impl/core/ops/arith/trait.Sub.js new file mode 100644 index 0000000..ad624cf --- /dev/null +++ b/trait.impl/core/ops/arith/trait.Sub.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl Sub for DescriptorAttr"],["impl Sub for PTEFlags"],["impl Sub for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/arith/trait.SubAssign.js b/trait.impl/core/ops/arith/trait.SubAssign.js new file mode 100644 index 0000000..856e3ee --- /dev/null +++ b/trait.impl/core/ops/arith/trait.SubAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl SubAssign for DescriptorAttr"],["impl SubAssign for PTEFlags"],["impl SubAssign for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitAnd.js b/trait.impl/core/ops/bit/trait.BitAnd.js new file mode 100644 index 0000000..516e31b --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitAnd.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl BitAnd for DescriptorAttr"],["impl BitAnd for PTEFlags"],["impl BitAnd for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitAndAssign.js b/trait.impl/core/ops/bit/trait.BitAndAssign.js new file mode 100644 index 0000000..720c870 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitAndAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl BitAndAssign for DescriptorAttr"],["impl BitAndAssign for PTEFlags"],["impl BitAndAssign for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitOr.js b/trait.impl/core/ops/bit/trait.BitOr.js new file mode 100644 index 0000000..634bd1e --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitOr.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl BitOr for DescriptorAttr"],["impl BitOr for PTEFlags"],["impl BitOr for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitOrAssign.js b/trait.impl/core/ops/bit/trait.BitOrAssign.js new file mode 100644 index 0000000..b38b058 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitOrAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl BitOrAssign for DescriptorAttr"],["impl BitOrAssign for PTEFlags"],["impl BitOrAssign for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitXor.js b/trait.impl/core/ops/bit/trait.BitXor.js new file mode 100644 index 0000000..ffeccdb --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitXor.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl BitXor for DescriptorAttr"],["impl BitXor for PTEFlags"],["impl BitXor for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.BitXorAssign.js b/trait.impl/core/ops/bit/trait.BitXorAssign.js new file mode 100644 index 0000000..3db3f18 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.BitXorAssign.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl BitXorAssign for DescriptorAttr"],["impl BitXorAssign for PTEFlags"],["impl BitXorAssign for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/bit/trait.Not.js b/trait.impl/core/ops/bit/trait.Not.js new file mode 100644 index 0000000..43c94c2 --- /dev/null +++ b/trait.impl/core/ops/bit/trait.Not.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[["impl Not for DescriptorAttr"],["impl Not for PTEFlags"],["impl Not for MappingFlags"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/drop/trait.Drop.js b/trait.impl/core/ops/drop/trait.Drop.js new file mode 100644 index 0000000..0886ece --- /dev/null +++ b/trait.impl/core/ops/drop/trait.Drop.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_multiarch":[["impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> Drop for PageTable64<M, PTE, H>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js new file mode 100644 index 0000000..b52b00c --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl RefUnwindSafe for MemAttr",1,["page_table_entry::arch::aarch64::MemAttr"]],["impl RefUnwindSafe for A64PTE",1,["page_table_entry::arch::aarch64::A64PTE"]],["impl RefUnwindSafe for DescriptorAttr",1,["page_table_entry::arch::aarch64::DescriptorAttr"]],["impl RefUnwindSafe for PTEFlags",1,["page_table_entry::arch::riscv::PTEFlags"]],["impl RefUnwindSafe for Rv64PTE",1,["page_table_entry::arch::riscv::Rv64PTE"]],["impl RefUnwindSafe for MappingFlags",1,["page_table_entry::MappingFlags"]],["impl RefUnwindSafe for X64PTE",1,["page_table_entry::arch::x86_64::X64PTE"]]], +"page_table_multiarch":[["impl RefUnwindSafe for PageSize",1,["page_table_multiarch::PageSize"]],["impl RefUnwindSafe for PagingError",1,["page_table_multiarch::PagingError"]],["impl RefUnwindSafe for A64PagingMetaData",1,["page_table_multiarch::arch::aarch64::A64PagingMetaData"]],["impl RefUnwindSafe for Sv39MetaData",1,["page_table_multiarch::arch::riscv::Sv39MetaData"]],["impl RefUnwindSafe for Sv48MetaData",1,["page_table_multiarch::arch::riscv::Sv48MetaData"]],["impl RefUnwindSafe for X64PagingMetaData",1,["page_table_multiarch::arch::x86_64::X64PagingMetaData"]],["impl<M, PTE, H> RefUnwindSafe for PageTable64<M, PTE, H>
where\n M: RefUnwindSafe,\n PTE: RefUnwindSafe,\n H: RefUnwindSafe,
",1,["page_table_multiarch::bits64::PageTable64"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js new file mode 100644 index 0000000..2758e6c --- /dev/null +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -0,0 +1,4 @@ +(function() {var implementors = { +"page_table_entry":[["impl UnwindSafe for MemAttr",1,["page_table_entry::arch::aarch64::MemAttr"]],["impl UnwindSafe for A64PTE",1,["page_table_entry::arch::aarch64::A64PTE"]],["impl UnwindSafe for DescriptorAttr",1,["page_table_entry::arch::aarch64::DescriptorAttr"]],["impl UnwindSafe for PTEFlags",1,["page_table_entry::arch::riscv::PTEFlags"]],["impl UnwindSafe for Rv64PTE",1,["page_table_entry::arch::riscv::Rv64PTE"]],["impl UnwindSafe for MappingFlags",1,["page_table_entry::MappingFlags"]],["impl UnwindSafe for X64PTE",1,["page_table_entry::arch::x86_64::X64PTE"]]], +"page_table_multiarch":[["impl UnwindSafe for PageSize",1,["page_table_multiarch::PageSize"]],["impl UnwindSafe for PagingError",1,["page_table_multiarch::PagingError"]],["impl UnwindSafe for A64PagingMetaData",1,["page_table_multiarch::arch::aarch64::A64PagingMetaData"]],["impl UnwindSafe for Sv39MetaData",1,["page_table_multiarch::arch::riscv::Sv39MetaData"]],["impl UnwindSafe for Sv48MetaData",1,["page_table_multiarch::arch::riscv::Sv48MetaData"]],["impl UnwindSafe for X64PagingMetaData",1,["page_table_multiarch::arch::x86_64::X64PagingMetaData"]],["impl<M, PTE, H> UnwindSafe for PageTable64<M, PTE, H>
where\n M: UnwindSafe,\n PTE: UnwindSafe,\n H: UnwindSafe,
",1,["page_table_multiarch::bits64::PageTable64"]]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/page_table_entry/trait.GenericPTE.js b/trait.impl/page_table_entry/trait.GenericPTE.js new file mode 100644 index 0000000..a8371e5 --- /dev/null +++ b/trait.impl/page_table_entry/trait.GenericPTE.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_entry":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/page_table_multiarch/trait.PagingMetaData.js b/trait.impl/page_table_multiarch/trait.PagingMetaData.js new file mode 100644 index 0000000..0378302 --- /dev/null +++ b/trait.impl/page_table_multiarch/trait.PagingMetaData.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"page_table_multiarch":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/type.impl/core/result/enum.Result.js b/type.impl/core/result/enum.Result.js new file mode 100644 index 0000000..37c3140 --- /dev/null +++ b/type.impl/core/result/enum.Result.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"page_table_multiarch":[["
1.0.0 · source§

impl<T, E> Clone for Result<T, E>
where\n T: Clone,\n E: Clone,

source§

fn clone(&self) -> Result<T, E>

Returns a copy of the value. Read more
source§

fn clone_from(&mut self, source: &Result<T, E>)

Performs copy-assignment from source. Read more
","Clone","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> Debug for Result<T, E>
where\n T: Debug,\n E: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
","Debug","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>
where\n V: FromIterator<A>,

source§

fn from_iter<I>(iter: I) -> Result<V, E>
where\n I: IntoIterator<Item = Result<A, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

\n

Here is an example which increments every integer in a vector,\nchecking for overflow:

\n\n
let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or(\"Overflow!\")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
\n

Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

\n\n
let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or(\"Underflow!\")\n).collect();\nassert_eq!(res, Err(\"Underflow!\"));
\n

Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

\n\n
let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or(\"Underflow!\")\n}).collect();\nassert_eq!(res, Err(\"Underflow!\"));\nassert_eq!(shared, 6);
\n

Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

\n
","FromIterator>","page_table_multiarch::PagingResult"],["
source§

impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","page_table_multiarch::PagingResult"],["
source§

impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>
where\n F: From<E>,

source§

fn from_residual(_: Yeet<E>) -> Result<T, F>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from a compatible Residual type. Read more
","FromResidual>","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> Hash for Result<T, E>
where\n T: Hash,\n E: Hash,

source§

fn hash<__H>(&self, state: &mut __H)
where\n __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where\n H: Hasher,\n Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
","Hash","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> IntoIterator for Result<T, E>

source§

fn into_iter(self) -> IntoIter<T>

Returns a consuming iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
\n
§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
","IntoIterator","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> Ord for Result<T, E>
where\n T: Ord,\n E: Ord,

source§

fn cmp(&self, other: &Result<T, E>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where\n Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where\n 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\n Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
","Ord","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> PartialEq for Result<T, E>
where\n T: PartialEq,\n E: PartialEq,

source§

fn eq(&self, other: &Result<T, E>) -> bool

This method tests for self and other values to be equal, and is used\nby ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
","PartialEq","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> PartialOrd for Result<T, E>
where\n T: PartialOrd,\n E: PartialOrd,

source§

fn partial_cmp(&self, other: &Result<T, E>) -> 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 <=\noperator. 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 >=\noperator. Read more
","PartialOrd","page_table_multiarch::PagingResult"],["
1.16.0 · source§

impl<T, U, E> Product<Result<U, E>> for Result<T, E>
where\n T: Product<U>,

source§

fn product<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

\n
§Examples
\n

This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

\n\n
let nums = vec![\"5\", \"10\", \"1\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec![\"5\", \"10\", \"one\", \"2\"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
\n
","Product>","page_table_multiarch::PagingResult"],["
source§

impl<T, E> Residual<T> for Result<Infallible, E>

§

type TryType = Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2_residual)
The “return” type of this meta-function.
","Residual","page_table_multiarch::PagingResult"],["
source§

impl<T, E> Result<&T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"page_table_multiarch::PagingResult"],["
source§

impl<T, E> Result<&mut T, E>

1.59.0 · source

pub fn copied(self) -> Result<T, E>
where\n T: Copy,

Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
\n
1.59.0 · source

pub fn cloned(self) -> Result<T, E>
where\n T: Clone,

Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

\n
§Examples
\n
let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
\n
",0,"page_table_multiarch::PagingResult"],["
source§

impl<T, E> Result<Option<T>, E>

1.33.0 (const: unstable) · source

pub fn transpose(self) -> Option<Result<T, E>>

Transposes a Result of an Option into an Option of a Result.

\n

Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

\n
§Examples
\n
#[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
\n
",0,"page_table_multiarch::PagingResult"],["
source§

impl<T, E> Result<Result<T, E>, E>

source

pub fn flatten(self) -> Result<T, E>

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

Converts from Result<Result<T, E>, E> to Result<T, E>

\n
§Examples
\n
#![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok(\"hello\"));\nassert_eq!(Ok(\"hello\"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
\n

Flattening only removes one level of nesting at a time:

\n\n
#![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok(\"hello\")));\nassert_eq!(Ok(Ok(\"hello\")), x.flatten());\nassert_eq!(Ok(\"hello\"), x.flatten().flatten());
\n
",0,"page_table_multiarch::PagingResult"],["
source§

impl<T, E> Result<T, E>

1.0.0 (const: 1.48.0) · source

pub const fn is_ok(&self) -> bool

Returns true if the result is Ok.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_ok(), false);
\n
1.70.0 · source

pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

Returns true if the result is Ok and the value inside of it matches a predicate.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err(\"hey\");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
\n
1.0.0 (const: 1.48.0) · source

pub const fn is_err(&self) -> bool

Returns true if the result is Err.

\n
§Examples
\n
let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err(\"Some error message\");\nassert_eq!(x.is_err(), true);
\n
1.70.0 · source

pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

Returns true if the result is Err and the value inside of it matches a predicate.

\n
§Examples
\n
use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, \"!\"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
\n
1.0.0 · source

pub fn ok(self) -> Option<T>

Converts from Result<T, E> to Option<T>.

\n

Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.ok(), None);
\n
1.0.0 · source

pub fn err(self) -> Option<E>

Converts from Result<T, E> to Option<E>.

\n

Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err(\"Nothing here\");\nassert_eq!(x.err(), Some(\"Nothing here\"));
\n
1.0.0 (const: 1.48.0) · source

pub const fn as_ref(&self) -> Result<&T, &E>

Converts from &Result<T, E> to Result<&T, &E>.

\n

Produces a new Result, containing a reference\ninto the original, leaving the original in place.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err(\"Error\");\nassert_eq!(x.as_ref(), Err(&\"Error\"));
\n
1.0.0 (const: unstable) · source

pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

\n
§Examples
\n
fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
\n
1.0.0 · source

pub fn map<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> U,

Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

\n

This function can be used to compose the results of two functions.

\n
§Examples
\n

Print the numbers on each line of a string multiplied by two.

\n\n
let line = \"1\\n2\\n3\\n4\\n\";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!(\"{n}\"),\n        Err(..) => {}\n    }\n}
\n
1.41.0 · source

pub fn map_or<U, F>(self, default: U, f: F) -> U
where\n F: FnOnce(T) -> U,

Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

\n

Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let x: Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
\n
1.41.0 · source

pub fn map_or_else<U, D, F>(self, default: D, f: F) -> U
where\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

\n

This function can be used to unpack a successful result\nwhile handling an error.

\n
§Examples
\n
let k = 21;\n\nlet x : Result<_, &str> = Ok(\"foo\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err(\"bar\");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
\n
1.0.0 · source

pub fn map_err<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> F,

Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

\n

This function can be used to pass through a successful result while handling\nan error.

\n
§Examples
\n
fn stringify(x: u32) -> String { format!(\"error code: {x}\") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err(\"error code: 13\".to_string()));
\n
1.76.0 · source

pub fn inspect<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&T),

Calls a function with a reference to the contained value if Ok.

\n

Returns the original result.

\n
§Examples
\n
let x: u8 = \"4\"\n    .parse::<u8>()\n    .inspect(|x| println!(\"original: {x}\"))\n    .map(|x| x.pow(3))\n    .expect(\"failed to parse number\");
\n
1.76.0 · source

pub fn inspect_err<F>(self, f: F) -> Result<T, E>
where\n F: FnOnce(&E),

Calls a function with a reference to the contained value if Err.

\n

Returns the original result.

\n
§Examples
\n
use std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string(\"address.txt\")\n        .inspect_err(|e| eprintln!(\"failed to read file: {e}\"))\n}
\n
1.47.0 · source

pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>
where\n T: Deref,

Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

\n

Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

\n
§Examples
\n
let x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&str, &u32> = Ok(\"hello\");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
\n
1.47.0 · source

pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>
where\n T: DerefMut,

Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

\n

Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

\n
§Examples
\n
let mut s = \"HELLO\".to_string();\nlet mut x: Result<String, u32> = Ok(\"hello\".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
\n
1.0.0 · source

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

Returns an iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter().next(), None);
\n
1.0.0 · source

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

Returns a mutable iterator over the possibly contained value.

\n

The iterator yields one value if the result is Result::Ok, otherwise none.

\n
§Examples
\n
let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err(\"nothing!\");\nassert_eq!(x.iter_mut().next(), None);
\n
1.4.0 · source

pub fn expect(self, msg: &str) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

\n
§Examples
\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.expect(\"Testing expect\"); // panics with `Testing expect: emergency failure`
\n
§Recommended Message Style
\n

We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

\n\n
let path = std::env::var(\"IMPORTANT_PATH\")\n    .expect(\"env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`\");
\n

Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

\n

For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

\n
1.0.0 · source

pub fn unwrap(self) -> T
where\n E: Debug,

Returns the contained Ok value, consuming the self value.

\n

Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

\n
§Panics
\n

Panics if the value is an Err, with a panic message provided by the\nErr’s value.

\n
§Examples
\n

Basic usage:

\n\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nx.unwrap(); // panics with `emergency failure`
\n
1.16.0 · source

pub fn unwrap_or_default(self) -> T
where\n T: Default,

Returns the contained Ok value or a default

\n

Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

\n
§Examples
\n

Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

\n\n
let good_year_from_input = \"1909\";\nlet bad_year_from_input = \"190blarg\";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
\n
1.17.0 · source

pub fn expect_err(self, msg: &str) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(10);\nx.expect_err(\"Testing expect_err\"); // panics with `Testing expect_err: 10`
\n
1.0.0 · source

pub fn unwrap_err(self) -> E
where\n T: Debug,

Returns the contained Err value, consuming the self value.

\n
§Panics
\n

Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(x.unwrap_err(), \"emergency failure\");
\n
source

pub fn into_ok(self) -> T
where\n E: Into<!>,

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

Returns the contained Ok value, but never panics.

\n

Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

\n
§Examples
\n
\nfn only_good_news() -> Result<String, !> {\n    Ok(\"this is fine\".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!(\"{s}\");
\n
source

pub fn into_err(self) -> E
where\n T: Into<!>,

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

Returns the contained Err value, but never panics.

\n

Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

\n
§Examples
\n
\nfn only_bad_news() -> Result<!, String> {\n    Err(\"Oops, it failed\".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!(\"{error}\");
\n
1.0.0 · source

pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

Returns res if the result is Ok, otherwise returns the Err value of self.

\n

Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<&str, &str> = Ok(\"foo\");\nassert_eq!(x.and(y), Err(\"early error\"));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<&str, &str> = Err(\"late error\");\nassert_eq!(x.and(y), Err(\"not a 2\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok(\"different result type\");\nassert_eq!(x.and(y), Ok(\"different result type\"));
\n
1.0.0 · source

pub fn and_then<U, F>(self, op: F) -> Result<U, E>
where\n F: FnOnce(T) -> Result<U, E>,

Calls op if the result is Ok, otherwise returns the Err value of self.

\n

This function can be used for control flow based on Result values.

\n
§Examples
\n
fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or(\"overflowed\")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err(\"overflowed\"));\nassert_eq!(Err(\"not a number\").and_then(sq_then_to_string), Err(\"not a number\"));
\n

Often used to chain fallible operations that may return Err.

\n\n
use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows \"/\" maps to \"C:\\\"\nlet root_modified_time = Path::new(\"/\").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new(\"/bad/path\").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
\n
1.0.0 · source

pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

Returns res if the result is Err, otherwise returns the Ok value of self.

\n

Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"early error\");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err(\"not a 2\");\nlet y: Result<u32, &str> = Err(\"late error\");\nassert_eq!(x.or(y), Err(\"late error\"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
\n
1.0.0 · source

pub fn or_else<F, O>(self, op: O) -> Result<T, F>
where\n O: FnOnce(E) -> Result<T, F>,

Calls op if the result is Err, otherwise returns the Ok value of self.

\n

This function can be used for control flow based on result values.

\n
§Examples
\n
fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
\n
1.0.0 · source

pub fn unwrap_or(self, default: T) -> T

Returns the contained Ok value or a provided default.

\n

Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

\n
§Examples
\n
let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err(\"error\");\nassert_eq!(x.unwrap_or(default), default);
\n
1.0.0 · source

pub fn unwrap_or_else<F>(self, op: F) -> T
where\n F: FnOnce(E) -> T,

Returns the contained Ok value or computes it from a closure.

\n
§Examples
\n
fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err(\"foo\").unwrap_or_else(count), 3);
\n
1.58.0 · source

pub unsafe fn unwrap_unchecked(self) -> T

Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

\n
§Safety
\n

Calling this method on an Err is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
\n
1.58.0 · source

pub unsafe fn unwrap_err_unchecked(self) -> E

Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

\n
§Safety
\n

Calling this method on an Ok is undefined behavior.

\n
§Examples
\n
let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
\n\n
let x: Result<u32, &str> = Err(\"emergency failure\");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, \"emergency failure\");
\n
",0,"page_table_multiarch::PagingResult"],["
1.16.0 · source§

impl<T, U, E> Sum<Result<U, E>> for Result<T, E>
where\n T: Sum<U>,

source§

fn sum<I>(iter: I) -> Result<T, E>
where\n I: Iterator<Item = Result<U, E>>,

Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

\n
§Examples
\n

This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

\n\n
let f = |&x: &i32| if x < 0 { Err(\"Negative element found\") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err(\"Negative element found\"));
\n
","Sum>","page_table_multiarch::PagingResult"],["
source§

impl<T, E> Try for Result<T, E>

§

type Output = T

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value produced by ? when not short-circuiting.
§

type Residual = Result<Infallible, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
source§

fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

🔬This is a nightly-only experimental API. (try_trait_v2)
Constructs the type from its Output type. Read more
source§

fn branch(\n self,\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

🔬This is a nightly-only experimental API. (try_trait_v2)
Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
","Try","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> Copy for Result<T, E>
where\n T: Copy,\n E: Copy,

","Copy","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> Eq for Result<T, E>
where\n T: Eq,\n E: Eq,

","Eq","page_table_multiarch::PagingResult"],["
1.0.0 · source§

impl<T, E> StructuralPartialEq for Result<T, E>

","StructuralPartialEq","page_table_multiarch::PagingResult"]] +};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/type.impl/page_table_multiarch/struct.PageTable64.js b/type.impl/page_table_multiarch/struct.PageTable64.js new file mode 100644 index 0000000..b5db4d2 --- /dev/null +++ b/type.impl/page_table_multiarch/struct.PageTable64.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"page_table_multiarch":[["
source§

impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> Drop for PageTable64<M, PTE, H>

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
","Drop","page_table_multiarch::arch::x86_64::X64PageTable","page_table_multiarch::arch::riscv::Sv39PageTable","page_table_multiarch::arch::riscv::Sv48PageTable","page_table_multiarch::arch::aarch64::A64PageTable"],["
source§

impl<M: PagingMetaData, PTE: GenericPTE, H: PagingHandler> PageTable64<M, PTE, H>

source

pub fn try_new() -> PagingResult<Self>

Creates a new page table instance or returns the error.

\n

It will allocate a new page for the root page table.

\n
source

pub const fn root_paddr(&self) -> PhysAddr

Returns the physical address of the root page table.

\n
source

pub fn map(\n &mut self,\n vaddr: VirtAddr,\n target: PhysAddr,\n page_size: PageSize,\n flags: MappingFlags,\n) -> PagingResult

Maps a virtual page to a physical frame with the given page_size\nand mapping flags.

\n

The virtual page starts with vaddr, amd the physical frame starts with\ntarget. If the addresses is not aligned to the page size, they will be\naligned down automatically.

\n

Returns Err(PagingError::AlreadyMapped)\nif the mapping is already present.

\n
source

pub fn unmap(&mut self, vaddr: VirtAddr) -> PagingResult<(PhysAddr, PageSize)>

Unmaps the mapping starts with vaddr.

\n

Returns Err(PagingError::NotMapped) if the\nmapping is not present.

\n
source

pub fn query(\n &self,\n vaddr: VirtAddr,\n) -> PagingResult<(PhysAddr, MappingFlags, PageSize)>

Query the result of the mapping starts with vaddr.

\n

Returns the physical address of the target frame, mapping flags, and\nthe page size.

\n

Returns Err(PagingError::NotMapped) if the\nmapping is not present.

\n
source

pub fn update(\n &mut self,\n vaddr: VirtAddr,\n paddr: Option<PhysAddr>,\n flags: Option<MappingFlags>,\n) -> PagingResult<PageSize>

Updates the target or flags of the mapping starts with vaddr. If the\ncorresponding argument is None, it will not be updated.

\n

Returns the page size of the mapping.

\n

Returns Err(PagingError::NotMapped) if the\nmapping is not present.

\n
source

pub fn map_region(\n &mut self,\n vaddr: VirtAddr,\n paddr: PhysAddr,\n size: usize,\n flags: MappingFlags,\n allow_huge: bool,\n) -> PagingResult

Map a contiguous virtual memory region to a contiguous physical memory\nregion with the given mapping flags.

\n

The virtual and physical memory regions start with vaddr and paddr\nrespectively. The region size is size. The addresses and size must\nbe aligned to 4K, otherwise it will return Err(PagingError::NotAligned).

\n

When allow_huge is true, it will try to map the region with huge pages\nif possible. Otherwise, it will map the region with 4K pages.

\n
source

pub fn unmap_region(&mut self, vaddr: VirtAddr, size: usize) -> PagingResult

Unmap a contiguous virtual memory region.

\n

The region must be mapped before using PageTable64::map_region, or\nunexpected behaviors may occur.

\n
source

pub fn walk<F>(&self, limit: usize, func: &F) -> PagingResult
where\n F: Fn(usize, usize, VirtAddr, &PTE),

Walk the page table recursively.

\n

When reaching the leaf page table, call func on the current page table\nentry. The max number of enumerations in one table is limited by limit.

\n

The arguments of func are:

\n
    \n
  • Current level (starts with 0): usize
  • \n
  • The index of the entry in the current-level table: usize
  • \n
  • The virtual address that is mapped to the entry: [VirtAddr]
  • \n
  • The reference of the entry: &PTE
  • \n
\n
",0,"page_table_multiarch::arch::x86_64::X64PageTable","page_table_multiarch::arch::riscv::Sv39PageTable","page_table_multiarch::arch::riscv::Sv48PageTable","page_table_multiarch::arch::aarch64::A64PageTable"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file