Struct gear_core::pages::WasmPage

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

Wasm page number.

Trait Implementations§

source§

impl Clone for WasmPage

source§

fn clone(&self) -> WasmPage

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 WasmPage

source§

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

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

impl Decode for WasmPage

source§

fn decode<__CodecInputEdqy: Input>( __codec_input_edqy: &mut __CodecInputEdqy ) -> Result<Self, Error>

Attempt to deserialise the value from input.
source§

fn decode_into<I>( input: &mut I, dst: &mut MaybeUninit<Self> ) -> Result<DecodeFinished, Error>
where I: Input,

Attempt to deserialize the value from input into a pre-allocated piece of memory. Read more
source§

fn skip<I>(input: &mut I) -> Result<(), Error>
where I: Input,

Attempt to skip the encoded value from input. Read more
source§

fn encoded_fixed_size() -> Option<usize>

Returns the fixed encoded size of the type. Read more
source§

impl Default for WasmPage

source§

fn default() -> WasmPage

Returns the “default value” for a type. Read more
source§

impl Encode for WasmPage

source§

fn size_hint(&self) -> usize

If possible give a hint of expected size of the encoding. Read more
source§

fn encode_to<__CodecOutputEdqy: Output + ?Sized>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )

Convert self to a slice and append it to the destination.
source§

fn encode(&self) -> Vec<u8>

Convert self to an owned vector.
source§

fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback: FnOnce(&[u8]) -> __CodecOutputReturn>( &self, f: __CodecUsingEncodedCallback ) -> __CodecOutputReturn

Convert self to a slice and then invoke the given closure with it.
source§

fn encoded_size(&self) -> usize

Calculates the encoded size. Read more
source§

impl From<WasmPage> for u32

source§

fn from(value: WasmPage) -> Self

Converts to this type from the input type.
source§

impl From<u16> for WasmPage

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl Ord for WasmPage

source§

fn cmp(&self, other: &WasmPage) -> Ordering

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

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

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

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl PageDynSize for WasmPage

source§

const SIZE_NO: usize = 0usize

Returns size number of page.
source§

fn size<S: SizeManager>(ctx: &S) -> u32

Returns size of page.
source§

fn new<S: SizeManager>(raw: u32, ctx: &S) -> Option<Self>

Creates page from raw number with specific context and checks that page number is valid. Returns None if page number is invalid.
source§

fn offset<S: SizeManager>(&self, ctx: &S) -> u32

Returns offset of page.
source§

fn end_offset<S: SizeManager>(&self, ctx: &S) -> u32

Returns offset of end of page.
source§

fn from_offset<S: SizeManager>(ctx: &S, offset: u32) -> Self

Creates page from offset.
source§

impl PageNumber for WasmPage

source§

unsafe fn from_raw(raw: u32) -> Self

Creates page from raw number. Read more
source§

fn raw(&self) -> u32

Returns raw (u32) page number.
source§

fn checked_sub(&self, other: Self) -> Option<Self>

Checked subtraction.
source§

fn iter_end_inclusive( &self, end: Self ) -> Result<PagesIterInclusive<Self>, PageError>

Returns iterator self..=end.
source§

impl PageU32Size for WasmPage

source§

fn size_non_zero() -> NonZeroU32

Returns size of page.
source§

unsafe fn new_unchecked(num: u32) -> Self

Constructs new page without any checks. Read more
source§

fn size() -> u32

Size as u32. Cannot be zero, because uses Self::size_non_zero.
source§

fn from_offset(offset: u32) -> Self

Constructs new page from byte offset: returns page which contains this byte.
source§

fn new(num: u32) -> Result<Self, PageError>

Constructs new page from raw page number with checks. Returns error if page will contain bytes, with offsets bigger then u32::MAX.
source§

fn offset(&self) -> u32

Returns page zero byte offset.
source§

fn end_offset(&self) -> u32

Returns page last byte offset.
source§

fn to_page<P1: PageU32Size>(&self) -> P1

Returns new page, which contains self zero byte.
source§

fn to_last_page<P1: PageU32Size>(&self) -> P1

Returns new page, which contains self last byte.
source§

fn add_raw(&self, raw: u32) -> Result<Self, PageError>

Returns page which has number page.raw() + raw, with checks.
source§

fn sub_raw(&self, raw: u32) -> Result<Self, PageError>

Returns page which has number page.raw() - raw, with checks.
source§

fn add(&self, other: Self) -> Result<Self, PageError>

Returns page which has number page.raw() + other.raw(), with checks.
source§

fn sub(&self, other: Self) -> Result<Self, PageError>

Returns page which has number page.raw() - other.raw(), with checks.
source§

fn inc(&self) -> Result<Self, PageError>

Returns page which has number page.raw() + 1, with checks.
source§

fn dec(&self) -> Result<Self, PageError>

Returns page which has number page.raw() - 1, with checks.
source§

fn align_down(&self, size: NonZeroU32) -> Self

Aligns page zero byte and returns page which contains this byte. Normally if size % Self::size() == 0, then aligned byte is zero byte of the returned page.
source§

fn zero() -> Self

Returns page, which has zero byte offset == 0.
source§

fn iter_count(&self, count: Self) -> Result<PagesIter<Self>, PageError>

Returns iterator self..self + count.
source§

fn iter_end(&self, end: Self) -> Result<PagesIter<Self>, PageError>

Returns iterator self..end.
source§

fn iter_from_zero_inclusive(&self) -> PagesIterInclusive<Self>

Returns iterator 0..=self
source§

fn iter_from_zero(&self) -> PagesIter<Self>

Returns iterator 0..self
source§

fn iter_once(&self) -> PagesIterInclusive<Self>

Returns iterator self..=self
source§

fn to_pages_iter<P: PageU32Size>(&self) -> PagesIterInclusive<P>

Returns an iterator that iterates over the range of pages from self to the end page, inclusive. Each iteration yields a page of type P. Read more
source§

impl PartialEq for WasmPage

source§

fn eq(&self, other: &WasmPage) -> bool

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

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

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for WasmPage

source§

fn partial_cmp(&self, other: &WasmPage) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

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

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

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

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

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

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

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

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl TypeInfo for WasmPage

§

type Identity = WasmPage

The type identifying for which type info is provided. Read more
source§

fn type_info() -> Type

Returns the static type identifier for Self.
source§

impl Copy for WasmPage

source§

impl EncodeLike for WasmPage

source§

impl Eq for WasmPage

source§

impl StructuralEq for WasmPage

source§

impl StructuralPartialEq for WasmPage

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> DecodeAll for T
where T: Decode,

source§

fn decode_all(input: &mut &[u8]) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
source§

impl<T> DecodeLimit for T
where T: Decode,

source§

fn decode_all_with_depth_limit( limit: u32, input: &mut &[u8] ) -> Result<T, Error>

Decode Self and consume all of the given input data. Read more
source§

fn decode_with_depth_limit<I>(limit: u32, input: &mut I) -> Result<T, Error>
where I: Input,

Decode Self with the given maximum recursion depth and advance input by the number of bytes consumed. Read more
source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> KeyedVec for T
where T: Codec,

source§

fn to_keyed_vec(&self, prepend_key: &[u8]) -> Vec<u8>

Return an encoding of Self prepended by given slice.
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.
source§

impl<S> Codec for S
where S: Decode + Encode,

source§

impl<T> EncodeLike<&&T> for T
where T: Encode,

source§

impl<T> EncodeLike<&T> for T
where T: Encode,

source§

impl<T> EncodeLike<&mut T> for T
where T: Encode,

source§

impl<T> EncodeLike<Arc<T>> for T
where T: Encode,

source§

impl<T> EncodeLike<Box<T>> for T
where T: Encode,

source§

impl<'a, T> EncodeLike<Cow<'a, T>> for T
where T: ToOwned + Encode,

source§

impl<T> EncodeLike<Rc<T>> for T
where T: Encode,

source§

impl<S> FullCodec for S
where S: Decode + FullEncode,

source§

impl<S> FullEncode for S
where S: Encode + EncodeLike,

source§

impl<T> JsonSchemaMaybe for T

source§

impl<T> StaticTypeInfo for T
where T: TypeInfo + 'static,