Struct cranelift_codegen::ir::constant::ConstantData
source · [−]pub struct ConstantData(_);
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
Trait Implementations
sourceimpl Clone for ConstantData
impl Clone for ConstantData
sourcefn clone(&self) -> ConstantData
fn clone(&self) -> ConstantData
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConstantData
impl Debug for ConstantData
sourceimpl Default for ConstantData
impl Default for ConstantData
sourcefn default() -> ConstantData
fn default() -> ConstantData
Returns the “default value” for a type. Read more
sourceimpl Display for ConstantData
impl Display for ConstantData
sourcefn 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");
sourceimpl From<&[u8]> for ConstantData
impl From<&[u8]> for ConstantData
sourceimpl From<V128Imm> for ConstantData
impl From<V128Imm> for ConstantData
sourceimpl FromIterator<u8> for ConstantData
impl FromIterator<u8> for ConstantData
sourcefn from_iter<T: IntoIterator<Item = u8>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = u8>>(iter: T) -> Self
Creates a value from an iterator. Read more
sourceimpl FromStr for ConstantData
impl FromStr for ConstantData
sourceimpl Hash for ConstantData
impl Hash for ConstantData
sourceimpl PartialEq<ConstantData> for ConstantData
impl PartialEq<ConstantData> for ConstantData
sourcefn 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 ==
. Read more
sourcefn ne(&self, other: &ConstantData) -> bool
fn ne(&self, other: &ConstantData) -> bool
This method tests for !=
.
impl 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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.