pub struct CanonicalAbiInfo {
pub size32: u32,
pub align32: u32,
pub size64: u32,
pub align64: u32,
pub flat_count: Option<u8>,
}
Expand description
Bye information about a type in the canonical ABI, with metadata for both memory32 and memory64-based types.
Fields§
§size32: u32
The byte-size of this type in a 32-bit memory.
align32: u32
The byte-alignment of this type in a 32-bit memory.
size64: u32
The byte-size of this type in a 64-bit memory.
align64: u32
The byte-alignment of this type in a 64-bit memory.
flat_count: Option<u8>
The number of types it takes to represents this type in the “flat” representation of the canonical abi where everything is passed as immediate arguments or results.
If this is None
then this type is not representable in the flat ABI
because it is too large.
Implementations§
source§impl CanonicalAbiInfo
impl CanonicalAbiInfo
sourcepub const SCALAR1: CanonicalAbiInfo = _
pub const SCALAR1: CanonicalAbiInfo = _
ABI information for one-byte scalars.
sourcepub const SCALAR2: CanonicalAbiInfo = _
pub const SCALAR2: CanonicalAbiInfo = _
ABI information for two-byte scalars.
sourcepub const SCALAR4: CanonicalAbiInfo = _
pub const SCALAR4: CanonicalAbiInfo = _
ABI information for four-byte scalars.
sourcepub const SCALAR8: CanonicalAbiInfo = _
pub const SCALAR8: CanonicalAbiInfo = _
ABI information for eight-byte scalars.
sourcepub const POINTER_PAIR: CanonicalAbiInfo = _
pub const POINTER_PAIR: CanonicalAbiInfo = _
ABI information for lists/strings which are “pointer pairs”
sourcepub fn record<'a>(
fields: impl Iterator<Item = &'a CanonicalAbiInfo>,
) -> CanonicalAbiInfo
pub fn record<'a>( fields: impl Iterator<Item = &'a CanonicalAbiInfo>, ) -> CanonicalAbiInfo
Returns the abi for a record represented by the specified fields.
sourcepub const fn record_static(fields: &[CanonicalAbiInfo]) -> CanonicalAbiInfo
pub const fn record_static(fields: &[CanonicalAbiInfo]) -> CanonicalAbiInfo
Same as CanonicalAbiInfo::record
but in a const
-friendly context.
sourcepub fn next_field32(&self, offset: &mut u32) -> u32
pub fn next_field32(&self, offset: &mut u32) -> u32
Returns the delta from the current value of offset
to align properly
and read the next record field of type abi
for 32-bit memories.
sourcepub fn next_field32_size(&self, offset: &mut usize) -> usize
pub fn next_field32_size(&self, offset: &mut usize) -> usize
Same as next_field32
, but bumps a usize pointer
sourcepub fn next_field64(&self, offset: &mut u32) -> u32
pub fn next_field64(&self, offset: &mut u32) -> u32
Returns the delta from the current value of offset
to align properly
and read the next record field of type abi
for 64-bit memories.
sourcepub fn next_field64_size(&self, offset: &mut usize) -> usize
pub fn next_field64_size(&self, offset: &mut usize) -> usize
Same as next_field64
, but bumps a usize pointer
sourcepub const fn flags(count: usize) -> CanonicalAbiInfo
pub const fn flags(count: usize) -> CanonicalAbiInfo
Returns ABI information for a structure which contains count
flags.
sourcepub const fn variant_static(
cases: &[Option<CanonicalAbiInfo>],
) -> CanonicalAbiInfo
pub const fn variant_static( cases: &[Option<CanonicalAbiInfo>], ) -> CanonicalAbiInfo
Same as CanonicalAbiInfo::variant
but const
-safe
sourcepub const fn enum_(cases: usize) -> CanonicalAbiInfo
pub const fn enum_(cases: usize) -> CanonicalAbiInfo
Calculates ABI information for an enum with cases
cases.
sourcepub fn flat_count(&self, max: usize) -> Option<usize>
pub fn flat_count(&self, max: usize) -> Option<usize>
Returns the flat count of this ABI information so long as the count
doesn’t exceed the max
specified.
Trait Implementations§
source§impl Clone for CanonicalAbiInfo
impl Clone for CanonicalAbiInfo
source§fn clone(&self) -> CanonicalAbiInfo
fn clone(&self) -> CanonicalAbiInfo
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for CanonicalAbiInfo
impl Debug for CanonicalAbiInfo
source§impl Default for CanonicalAbiInfo
impl Default for CanonicalAbiInfo
source§fn default() -> CanonicalAbiInfo
fn default() -> CanonicalAbiInfo
source§impl<'de> Deserialize<'de> for CanonicalAbiInfo
impl<'de> Deserialize<'de> for CanonicalAbiInfo
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl Hash for CanonicalAbiInfo
impl Hash for CanonicalAbiInfo
source§impl PartialEq for CanonicalAbiInfo
impl PartialEq for CanonicalAbiInfo
source§impl Serialize for CanonicalAbiInfo
impl Serialize for CanonicalAbiInfo
impl Eq for CanonicalAbiInfo
impl StructuralPartialEq for CanonicalAbiInfo
Auto Trait Implementations§
impl Freeze for CanonicalAbiInfo
impl RefUnwindSafe for CanonicalAbiInfo
impl Send for CanonicalAbiInfo
impl Sync for CanonicalAbiInfo
impl Unpin for CanonicalAbiInfo
impl UnwindSafe for CanonicalAbiInfo
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
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)
clone_to_uninit
)§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
§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
key
and return true
if they are equal.