[][src]Struct dynasm::Number

pub struct Number { /* fields omitted */ }

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]

impl Ord for Number[src]

impl PartialEq<Number> for Number[src]

impl PartialOrd<Number> for Number[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]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.