Struct cranelift_codegen::ir::constant::ConstantData
source · 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<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<ConstantData> for ConstantData
impl PartialEq<ConstantData> for ConstantData
source§fn eq(&self, other: &ConstantData) -> bool
fn eq(&self, other: &ConstantData) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<ConstantData> for ConstantData
impl PartialOrd<ConstantData> for ConstantData
source§fn partial_cmp(&self, other: &ConstantData) -> Option<Ordering>
fn partial_cmp(&self, other: &ConstantData) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Eq for ConstantData
impl StructuralEq for ConstantData
impl StructuralPartialEq for ConstantData
Auto Trait Implementations§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.