pub(super) struct HostOffset(pub u64);
Expand description
Host cluster offset.
Tuple Fields§
§0: u64
Implementations§
Source§impl HostOffset
impl HostOffset
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 host cluster.
Sourcepub fn cluster(self, cluster_bits: u32) -> HostCluster
pub fn cluster(self, cluster_bits: u32) -> HostCluster
Return the containing cluster’s index.
Sourcepub fn checked_cluster(self, cluster_bits: u32) -> Option<HostCluster>
pub fn checked_cluster(self, cluster_bits: u32) -> Option<HostCluster>
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.
Trait Implementations§
Source§impl Add<u64> for HostOffset
impl Add<u64> for HostOffset
Source§impl Clone for HostOffset
impl Clone for HostOffset
Source§fn clone(&self) -> HostOffset
fn clone(&self) -> HostOffset
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 HostOffset
impl Debug for HostOffset
Source§impl Display for HostOffset
impl Display for HostOffset
Source§impl Hash for HostOffset
impl Hash for HostOffset
Source§impl Ord for HostOffset
impl Ord for HostOffset
Source§fn cmp(&self, other: &HostOffset) -> Ordering
fn cmp(&self, other: &HostOffset) -> 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 HostOffset
impl PartialEq for HostOffset
Source§impl PartialOrd for HostOffset
impl PartialOrd for HostOffset
Source§impl Sub<u64> for HostOffset
impl Sub<u64> for HostOffset
Source§impl Sub for HostOffset
impl Sub for HostOffset
impl Copy for HostOffset
impl Eq for HostOffset
impl StructuralPartialEq for HostOffset
Auto Trait Implementations§
impl Freeze for HostOffset
impl RefUnwindSafe for HostOffset
impl Send for HostOffset
impl Sync for HostOffset
impl Unpin for HostOffset
impl UnwindSafe for HostOffset
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