pub struct ConstantData(/* private fields */);
Expand description
This type describes the actual constant data. Note that the bytes stored in this structure are expected to be in little-endian order; this is due to ease-of-use when interacting with WebAssembly values, which are little-endian by design.
Implementations§
Source§impl ConstantData
impl ConstantData
Trait Implementations§
Source§impl Clone for ConstantData
impl Clone for ConstantData
Source§fn clone(&self) -> ConstantData
fn clone(&self) -> ConstantData
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 ConstantData
impl Debug for ConstantData
Source§impl Default for ConstantData
impl Default for ConstantData
Source§fn default() -> ConstantData
fn default() -> ConstantData
Returns the “default value” for a type. Read more
Source§impl Display for ConstantData
impl Display for ConstantData
Source§fn fmt(&self, f: &mut Formatter<'_>) -> Result
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Print the constant data in hexadecimal format, e.g. 0x000102030405060708090a0b0c0d0e0f. This function will flip the stored order of bytes–little-endian–to the more readable big-endian ordering.
use cranelift_codegen::ir::ConstantData;
let data = ConstantData::from([3, 2, 1, 0, 0].as_ref()); // note the little-endian order
assert_eq!(data.to_string(), "0x0000010203");
Source§impl From<&[u8]> for ConstantData
impl From<&[u8]> for ConstantData
Source§impl From<Ieee128> for ConstantData
impl From<Ieee128> for ConstantData
Source§impl From<V128Imm> for ConstantData
impl From<V128Imm> for ConstantData
Source§impl FromIterator<u8> for ConstantData
impl FromIterator<u8> for ConstantData
Source§impl FromStr for ConstantData
impl FromStr for ConstantData
Source§impl Hash for ConstantData
impl Hash for ConstantData
Source§impl Ord for ConstantData
impl Ord for ConstantData
Source§fn cmp(&self, other: &ConstantData) -> Ordering
fn cmp(&self, other: &ConstantData) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ConstantData
impl PartialEq for ConstantData
Source§impl PartialOrd for ConstantData
impl PartialOrd for ConstantData
Source§impl TryFrom<&ConstantData> for Ieee128
impl TryFrom<&ConstantData> for Ieee128
impl Eq for ConstantData
impl StructuralPartialEq for ConstantData
Auto Trait Implementations§
impl Freeze for ConstantData
impl RefUnwindSafe for ConstantData
impl Send for ConstantData
impl Sync for ConstantData
impl Unpin for ConstantData
impl UnwindSafe for ConstantData
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> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
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.