Struct wit_parser::ArchitectureSize
source · 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: usize
architecture independent bytes
pointers: usize
amount of pointer sized units to add
Implementations§
source§impl ArchitectureSize
impl ArchitectureSize
pub fn new(bytes: usize, pointers: usize) -> Self
pub fn max<B: Borrow<Self>>(&self, other: B) -> Self
pub fn add_bytes(&self, b: usize) -> Self
sourcepub 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
sourcepub 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
Trait Implementations§
source§impl Add for ArchitectureSize
impl Add for ArchitectureSize
source§type Output = ArchitectureSize
type Output = ArchitectureSize
The resulting type after applying the
+
operator.source§impl AddAssign for ArchitectureSize
impl AddAssign for ArchitectureSize
source§fn add_assign(&mut self, rhs: ArchitectureSize)
fn add_assign(&mut self, rhs: ArchitectureSize)
Performs the
+=
operation. Read moresource§impl Clone for ArchitectureSize
impl Clone for ArchitectureSize
source§fn clone(&self) -> ArchitectureSize
fn clone(&self) -> ArchitectureSize
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ArchitectureSize
impl Debug for ArchitectureSize
source§impl Default for ArchitectureSize
impl Default for ArchitectureSize
source§fn default() -> ArchitectureSize
fn default() -> ArchitectureSize
Returns the “default value” for a type. Read more
source§impl From<Alignment> for ArchitectureSize
impl From<Alignment> for ArchitectureSize
source§impl PartialEq for ArchitectureSize
impl PartialEq for ArchitectureSize
impl Copy for ArchitectureSize
impl Eq for ArchitectureSize
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 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.