Struct wasmtime_runtime::I31
source · pub struct I31(/* private fields */);
Expand description
A 31-bit integer for use with i31ref
.
Implementations§
source§impl I31
impl I31
sourcepub fn new_u32(value: u32) -> Option<Self>
pub fn new_u32(value: u32) -> Option<Self>
Construct a new I31
from the given unsigned value.
Returns None
if the value does not fit in the bottom 31 bits.
sourcepub fn new_i32(value: i32) -> Option<Self>
pub fn new_i32(value: i32) -> Option<Self>
Construct a new I31
from the given signed value.
Returns None
if the value does not fit in the bottom 31 bits.
sourcepub fn wrapping_u32(value: u32) -> Self
pub fn wrapping_u32(value: u32) -> Self
Construct a new I31
from the given unsigned value.
If the value doesn’t fit in the bottom 31 bits, it is wrapped such that the wrapped value does.
sourcepub fn wrapping_i32(value: i32) -> Self
pub fn wrapping_i32(value: i32) -> Self
Construct a new I31
from the given signed value.
If the value doesn’t fit in the bottom 31 bits, it is wrapped such that the wrapped value does.
Trait Implementations§
impl Copy for I31
impl Eq for I31
impl StructuralPartialEq for I31
Auto Trait Implementations§
impl Freeze for I31
impl RefUnwindSafe for I31
impl Send for I31
impl Sync for I31
impl Unpin for I31
impl UnwindSafe for I31
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<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.