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 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
)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
key
and return true
if they are equal.