pub struct MachineRegister { /* private fields */ }Expand description
MachineRegister is a datatype that can hold exactly the contents of a
register with no additional semantic information.
MachineRegister is useful when you know data is the size of a register,
but not its true data type. In the future it may be possible, useful, or
necessary to change the implementation of MachineRegister, however, the
semantics will remain. No use of MachineRegister should assume a
particular Rust implementation or any semantics other this description.
Implementations§
Source§impl MachineRegister
impl MachineRegister
Sourcepub fn as_capability_ptr(self) -> CapabilityPtr
pub fn as_capability_ptr(self) -> CapabilityPtr
Returns this MachineRegister as a CapabilityPtr.
If this MachineRegister contains a pointer with provenance and/or
authority, the returned CapabilityPtr will have the same provenance
and/or authority.
Sourcepub fn as_usize(self) -> usize
pub fn as_usize(self) -> usize
Returns this MachineRegister as a usize.
This is intended for use on MachineRegisters created from a
usize, in which case the original usize will be returned. If
this MachineRegister was created from a pointer, this returns the
pointer’s address (without exposing provenance).
Sourcepub fn as_usize_32bit(self) -> usize
pub fn as_usize_32bit(self) -> usize
Returns this MachineRegister as a usize, 32 bits only.
This returns a usize, but only uses the lowest 32 bits from the
MachineRegister. If there are upper bits, they are set to 0. This is
useful for capturing only the lower 32 bits on a 64-bit machine.
This is intended for use on MachineRegisters created from a
usize, in which case 32 bits of the original usize will be
returned. If this MachineRegister was created from a pointer, this
returns the lowest 32 bits of the pointer’s address (without exposing
provenance).
Trait Implementations§
Source§impl Clone for MachineRegister
impl Clone for MachineRegister
Source§fn clone(&self) -> MachineRegister
fn clone(&self) -> MachineRegister
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for MachineRegister
Source§impl Debug for MachineRegister
impl Debug for MachineRegister
Source§impl Default for MachineRegister
impl Default for MachineRegister
Source§fn default() -> MachineRegister
fn default() -> MachineRegister
impl Eq for MachineRegister
Source§impl From<CapabilityPtr> for MachineRegister
impl From<CapabilityPtr> for MachineRegister
Source§fn from(from: CapabilityPtr) -> Self
fn from(from: CapabilityPtr) -> Self
Creates a MachineRegister containing this CapabilityPtr,
including its provenance.