pub enum Primitive {
Int(Integer, bool),
Float(Float),
Pointer(AddressSpace),
}
Expand description
Fundamental unit of memory access and layout.
Variants§
Int(Integer, bool)
The bool
is the signedness of the Integer
type.
One would think we would not care about such details this low down, but some ABIs are described in terms of C types and ISAs where the integer arithmetic is done on {sign,zero}-extended registers, e.g. a negative integer passed by zero-extension will appear positive in the callee, and most operations on it will produce the wrong values.
Float(Float)
Pointer(AddressSpace)
Implementations§
Source§impl Primitive
impl Primitive
pub fn size<C: HasDataLayout>(self, cx: &C) -> Size
pub fn align<C: HasDataLayout>(self, cx: &C) -> AbiAndPrefAlign
Trait Implementations§
impl Copy for Primitive
impl Eq for Primitive
impl StructuralPartialEq for Primitive
Auto Trait Implementations§
impl Freeze for Primitive
impl RefUnwindSafe for Primitive
impl Send for Primitive
impl Sync for Primitive
impl Unpin for Primitive
impl UnwindSafe for Primitive
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