[−][src]Enum rustc_mir::interpret::Scalar

pub enum Scalar<Tag = ()> {
    Int(ScalarInt),
    Ptr(Pointer<Tag>),
}

A Scalar represents an immediate, primitive value existing outside of a memory::Allocation. It is in many ways like a small chunk of a Allocation, up to 8 bytes in size. Like a range of bytes in an Allocation, a Scalar can either represent the raw bytes of a simple value or a pointer into another Allocation

Variants

Int(ScalarInt)

The raw bytes of a simple value.

Ptr(Pointer<Tag>)

A pointer into an Allocation. An Allocation in the memory module has a list of relocations, but a Scalar is only large enough to contain one, so we just represent the relocation and its associated offset together as a Pointer here.

Trait Implementations

impl<Tag> From<Scalar<Tag>> for Immediate<Tag>[src]

Auto Trait Implementations

impl<Tag> RefUnwindSafe for Scalar<Tag> where
    Tag: RefUnwindSafe, 

impl<Tag> Send for Scalar<Tag> where
    Tag: Send, 

impl<Tag> Sync for Scalar<Tag> where
    Tag: Sync, 

impl<Tag> Unpin for Scalar<Tag> where
    Tag: Unpin, 

impl<Tag> UnwindSafe for Scalar<Tag> where
    Tag: UnwindSafe, 

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> ToString for T where
    T: Display + ?Sized, 
[src]

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.

impl<T> WithConstness for T[src]