Struct ArchitectureSize
pub struct ArchitectureSize {
pub bytes: usize,
pub pointers: usize,
}Expand description
Architecture specific measurement of position,
the combined amount in bytes is
bytes + pointers * core::mem::size_of::<*const u8>()
Fields§
§bytes: usizearchitecture independent bytes
pointers: usizeamount of pointer sized units to add
Implementations§
§impl ArchitectureSize
impl ArchitectureSize
pub fn new(bytes: usize, pointers: usize) -> ArchitectureSize
pub fn max<B>(&self, other: B) -> ArchitectureSizewhere
B: Borrow<ArchitectureSize>,
pub fn add_bytes(&self, b: usize) -> ArchitectureSize
pub fn constant_bytes(&self) -> usize
pub fn constant_bytes(&self) -> usize
The effective offset/size is
constant_bytes() + core::mem::size_of::<*const u8>() * pointers_to_add()
pub fn pointers_to_add(&self) -> usize
pub fn size_wasm32(&self) -> usize
pub fn size_wasm32(&self) -> usize
Shortcut for compatibility with previous versions
pub fn size_wasm64(&self) -> usize
pub fn format(&self, ptrsize_expr: &str) -> String
pub fn format_term(&self, ptrsize_expr: &str, suppress_brackets: bool) -> String
Trait Implementations§
§impl Add for ArchitectureSize
impl Add for ArchitectureSize
§type Output = ArchitectureSize
type Output = ArchitectureSize
The resulting type after applying the
+ operator.§fn add(self, rhs: ArchitectureSize) -> <ArchitectureSize as Add>::Output
fn add(self, rhs: ArchitectureSize) -> <ArchitectureSize as Add>::Output
Performs the
+ operation. Read more§impl AddAssign for ArchitectureSize
impl AddAssign for ArchitectureSize
§fn add_assign(&mut self, rhs: ArchitectureSize)
fn add_assign(&mut self, rhs: ArchitectureSize)
Performs the
+= operation. Read more§impl Clone for ArchitectureSize
impl Clone for ArchitectureSize
§fn clone(&self) -> ArchitectureSize
fn clone(&self) -> ArchitectureSize
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for ArchitectureSize
§impl Debug for ArchitectureSize
impl Debug for ArchitectureSize
§impl Default for ArchitectureSize
impl Default for ArchitectureSize
§fn default() -> ArchitectureSize
fn default() -> ArchitectureSize
Returns the “default value” for a type. Read more
impl Eq for ArchitectureSize
§impl From<Alignment> for ArchitectureSize
impl From<Alignment> for ArchitectureSize
§fn from(align: Alignment) -> ArchitectureSize
fn from(align: Alignment) -> ArchitectureSize
Converts to this type from the input type.
§impl PartialEq for ArchitectureSize
impl PartialEq for ArchitectureSize
§fn eq(&self, other: &ArchitectureSize) -> bool
fn eq(&self, other: &ArchitectureSize) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ArchitectureSize
Auto Trait Implementations§
impl Freeze for ArchitectureSize
impl RefUnwindSafe for ArchitectureSize
impl Send for ArchitectureSize
impl Sync for ArchitectureSize
impl Unpin for ArchitectureSize
impl UnsafeUnpin for ArchitectureSize
impl UnwindSafe for ArchitectureSize
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more