pub(super) struct GuestOffset(pub u64);
Expand description
Guest offset.
Tuple Fields§
§0: u64
Implementations§
Source§impl GuestOffset
impl GuestOffset
Sourcepub fn in_cluster_offset(self, cluster_bits: u32) -> usize
pub fn in_cluster_offset(self, cluster_bits: u32) -> usize
Return the offset from the start of the containing guest clusters.
Sourcepub fn l2_index(self, cluster_bits: u32) -> usize
pub fn l2_index(self, cluster_bits: u32) -> usize
Return the containing cluster’s index in its L2 table.
Sourcepub fn l1_index(self, cluster_bits: u32) -> usize
pub fn l1_index(self, cluster_bits: u32) -> usize
Return the containing cluster’s L2 table’s index in the L1 table.
Sourcepub fn cluster(self, cluster_bits: u32) -> GuestCluster
pub fn cluster(self, cluster_bits: u32) -> GuestCluster
Return the containing cluster’s index.
Sourcepub fn checked_cluster(self, cluster_bits: u32) -> Option<GuestCluster>
pub fn checked_cluster(self, cluster_bits: u32) -> Option<GuestCluster>
If this offset points to the start of a cluster, get its index.
If this offset points inside of a cluster, return None
. As oposed to just cluster()
,
this will not discard information: self.checked_cluster(cb).unwrap().offset() == self
,
because there is no in-cluster offset that could be lost.
Sourcepub fn remaining_in_cluster(self, cluster_bits: u32) -> u64
pub fn remaining_in_cluster(self, cluster_bits: u32) -> u64
How many bytes remain in this cluster after this offset.
Sourcepub fn remaining_in_l2_table(self, cluster_bits: u32) -> u64
pub fn remaining_in_l2_table(self, cluster_bits: u32) -> u64
How many bytes remain in this L2 table after this offset.
Trait Implementations§
Source§impl Add<u64> for GuestOffset
impl Add<u64> for GuestOffset
Source§impl Clone for GuestOffset
impl Clone for GuestOffset
Source§fn clone(&self) -> GuestOffset
fn clone(&self) -> GuestOffset
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for GuestOffset
impl Debug for GuestOffset
Source§impl Display for GuestOffset
impl Display for GuestOffset
Source§impl Hash for GuestOffset
impl Hash for GuestOffset
Source§impl Ord for GuestOffset
impl Ord for GuestOffset
Source§fn cmp(&self, other: &GuestOffset) -> Ordering
fn cmp(&self, other: &GuestOffset) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for GuestOffset
impl PartialEq for GuestOffset
Source§impl PartialOrd for GuestOffset
impl PartialOrd for GuestOffset
Source§impl Sub<u64> for GuestOffset
impl Sub<u64> for GuestOffset
Source§impl Sub for GuestOffset
impl Sub for GuestOffset
impl Copy for GuestOffset
impl Eq for GuestOffset
impl StructuralPartialEq for GuestOffset
Auto Trait Implementations§
impl Freeze for GuestOffset
impl RefUnwindSafe for GuestOffset
impl Send for GuestOffset
impl Sync for GuestOffset
impl Unpin for GuestOffset
impl UnwindSafe for GuestOffset
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