#[repr(C, align(16))]pub struct Align16I128(pub i128);
Expand description
A thin wrapper around i128 that ensures 16-byte alignment.
Since wasm is happy with 8-byte aligned i128
, a i128
value
would sometimes get placed into an 8-byte aligned memory address
by Rust when created in wasm-land, but this breaks memory safety requirements
if we want to access that value directly on the host side and triggering a relevant
assertion in safe casting functions. As a result,
in ffi types, this should always be used over a raw i128
Tuple Fields§
§0: i128
Trait Implementations§
Source§impl AsMut<i128> for Align16I128
impl AsMut<i128> for Align16I128
Source§impl AsRef<i128> for Align16I128
impl AsRef<i128> for Align16I128
Source§impl Clone for Align16I128
impl Clone for Align16I128
Source§fn clone(&self) -> Align16I128
fn clone(&self) -> Align16I128
Returns a duplicate 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 Align16I128
impl Debug for Align16I128
Source§impl Default for Align16I128
impl Default for Align16I128
Source§fn default() -> Align16I128
fn default() -> Align16I128
Returns the “default value” for a type. Read more
Source§impl Deref for Align16I128
impl Deref for Align16I128
Source§impl DerefMut for Align16I128
impl DerefMut for Align16I128
Source§impl Display for Align16I128
impl Display for Align16I128
Source§impl From<Align16I128> for i128
impl From<Align16I128> for i128
Source§fn from(value: Align16I128) -> Self
fn from(value: Align16I128) -> Self
Converts to this type from the input type.
Source§impl From<i128> for Align16I128
impl From<i128> for Align16I128
impl Copy for Align16I128
impl Pod for Align16I128
Auto Trait Implementations§
impl Freeze for Align16I128
impl RefUnwindSafe for Align16I128
impl Send for Align16I128
impl Sync for Align16I128
impl Unpin for Align16I128
impl UnwindSafe for Align16I128
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.