[−][src]Struct dynasm::Number
An integral value in a particular Numeric
representation.
Implementations
impl Number
[src]
pub const fn from_u64_and_size(val: u64, size: Size) -> Self
[src]
Cast a short constant to a specific representation.
pub const fn from_u64_and_repr(value: u64, repr: NumericRepr) -> Self
[src]
pub const fn repr(self) -> NumericRepr
[src]
pub fn byte(val: u8) -> Self
[src]
pub fn word(val: u16) -> Self
[src]
pub fn dword(val: u32) -> Self
[src]
pub fn qword(val: u64) -> Self
[src]
pub fn as_u8(self) -> u8
[src]
pub fn as_i8(self) -> i8
[src]
pub fn as_u16(self) -> u16
[src]
pub fn as_i16(self) -> i16
[src]
pub fn as_u32(self) -> u32
[src]
pub fn as_i32(self) -> i32
[src]
pub fn as_u64(self) -> u64
[src]
pub fn as_i64(self) -> i64
[src]
pub fn cast_as(self, repr: NumericRepr) -> Number
[src]
Perform a cast in 2-complement.
Casts work like Rust as
coercion. A sign extension is performed when the source is
signed, else the number is zero extended.
pub fn convert(self, repr: NumericRepr) -> Option<Number>
[src]
Do a value preserving (TryFrom
) conversion.
This is not the same as lossless, u32
and i32
can be converted without loss but do not
preserve the values.
pub fn make_signed(self, signed: bool) -> Number
[src]
pub const fn resize(self, size: Size) -> Number
[src]
Resize, keeping the same signedness.
pub fn write_le_bytes(self, buf: &mut Vec<u8>)
[src]
pub fn to_le_bytes(self) -> Vec<u8>
[src]
Trait Implementations
impl Clone for Number
[src]
impl Copy for Number
[src]
impl Debug for Number
[src]
impl Eq for Number
[src]
impl Hash for Number
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Number
[src]
fn cmp(&self, other: &Number) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Number> for Number
[src]
impl PartialOrd<Number> for Number
[src]
fn partial_cmp(&self, other: &Number) -> Option<Ordering>
[src]
fn lt(&self, other: &Number) -> bool
[src]
fn le(&self, other: &Number) -> bool
[src]
fn gt(&self, other: &Number) -> bool
[src]
fn ge(&self, other: &Number) -> bool
[src]
impl StructuralEq for Number
[src]
impl StructuralPartialEq for Number
[src]
Auto Trait Implementations
impl RefUnwindSafe for Number
impl Send for Number
impl Sync for Number
impl Unpin for Number
impl UnwindSafe for Number
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,