pub(super) struct HostCluster(pub u64);
Expand description
Host cluster index.
Tuple Fields§
§0: u64
Implementations§
Source§impl HostCluster
impl HostCluster
Sourcepub fn offset(self, cluster_bits: u32) -> HostOffset
pub fn offset(self, cluster_bits: u32) -> HostOffset
Return this cluster’s offset.
Sourcepub fn rt_index(self, rb_bits: u32) -> usize
pub fn rt_index(self, rb_bits: u32) -> usize
Get this cluster’s refcount block’s index in the refcount table.
Sourcepub fn rt_rb_indices(self, rb_bits: u32) -> (usize, usize)
pub fn rt_rb_indices(self, rb_bits: u32) -> (usize, usize)
Get both the reftable and refblock indices for this cluster.
Sourcepub fn from_ref_indices(rt_index: usize, rb_index: usize, rb_bits: u32) -> Self
pub fn from_ref_indices(rt_index: usize, rb_index: usize, rb_bits: u32) -> Self
Construct a cluster index from its reftable and refblock indices.
Sourcepub fn relative_offset(
self,
guest_offset: GuestOffset,
cluster_bits: u32,
) -> HostOffset
pub fn relative_offset( self, guest_offset: GuestOffset, cluster_bits: u32, ) -> HostOffset
Returns the host offset corresponding to guest_offset
.
Assuming guest_offset.cluster()
is mapped to self
, return the exact host offset
matching guest_offset
.
Same as self.offset(cb) + guest_offset.in_cluster_offset
.
Trait Implementations§
Source§impl Add<ClusterCount> for HostCluster
impl Add<ClusterCount> for HostCluster
Source§type Output = HostCluster
type Output = HostCluster
The resulting type after applying the
+
operator.Source§fn add(self, rhs: ClusterCount) -> Self
fn add(self, rhs: ClusterCount) -> Self
Performs the
+
operation. Read moreSource§impl AddAssign<ClusterCount> for HostCluster
impl AddAssign<ClusterCount> for HostCluster
Source§fn add_assign(&mut self, rhs: ClusterCount)
fn add_assign(&mut self, rhs: ClusterCount)
Performs the
+=
operation. Read moreSource§impl Clone for HostCluster
impl Clone for HostCluster
Source§fn clone(&self) -> HostCluster
fn clone(&self) -> HostCluster
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 HostCluster
impl Debug for HostCluster
Source§impl Hash for HostCluster
impl Hash for HostCluster
Source§impl Ord for HostCluster
impl Ord for HostCluster
Source§fn cmp(&self, other: &HostCluster) -> Ordering
fn cmp(&self, other: &HostCluster) -> 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 HostCluster
impl PartialEq for HostCluster
Source§impl PartialOrd for HostCluster
impl PartialOrd for HostCluster
Source§impl Sub<ClusterCount> for HostCluster
impl Sub<ClusterCount> for HostCluster
Source§type Output = HostCluster
type Output = HostCluster
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: ClusterCount) -> Self
fn sub(self, rhs: ClusterCount) -> Self
Performs the
-
operation. Read moreSource§impl Sub for HostCluster
impl Sub for HostCluster
Source§type Output = ClusterCount
type Output = ClusterCount
The resulting type after applying the
-
operator.Source§fn sub(self, rhs: Self) -> ClusterCount
fn sub(self, rhs: Self) -> ClusterCount
Performs the
-
operation. Read moreSource§impl SubAssign<ClusterCount> for HostCluster
impl SubAssign<ClusterCount> for HostCluster
Source§fn sub_assign(&mut self, rhs: ClusterCount)
fn sub_assign(&mut self, rhs: ClusterCount)
Performs the
-=
operation. Read moreimpl Copy for HostCluster
impl Eq for HostCluster
impl StructuralPartialEq for HostCluster
Auto Trait Implementations§
impl Freeze for HostCluster
impl RefUnwindSafe for HostCluster
impl Send for HostCluster
impl Sync for HostCluster
impl Unpin for HostCluster
impl UnwindSafe for HostCluster
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