pub struct SegmentEntry {
pub segment_id: SegmentId,
pub extent: Extent,
pub generation: u64,
pub data_len: u64,
}Expand description
An entry in the segment directory mapping a segment to its block location.
Each live segment is tracked in the metadata root block. The generation counter supports snapshot isolation — readers see a consistent view of which segments existed at their open time.
See [[architecture-storage-format#Root Metadata]].
Fields§
§segment_id: SegmentIdUnique identifier for this segment.
extent: ExtentContiguous block range where the segment data is stored.
generation: u64Monotonically increasing version counter. Incremented on each commit that modifies the segment directory.
data_len: u64Actual byte length of the segment data. May be less than
extent.byte_len() since the last block can be partially filled.
Implementations§
Trait Implementations§
Source§impl Clone for SegmentEntry
impl Clone for SegmentEntry
Source§fn clone(&self) -> SegmentEntry
fn clone(&self) -> SegmentEntry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for SegmentEntry
Source§impl Debug for SegmentEntry
impl Debug for SegmentEntry
impl Eq for SegmentEntry
Source§impl PartialEq for SegmentEntry
impl PartialEq for SegmentEntry
Source§fn eq(&self, other: &SegmentEntry) -> bool
fn eq(&self, other: &SegmentEntry) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for SegmentEntry
Auto Trait Implementations§
impl Freeze for SegmentEntry
impl RefUnwindSafe for SegmentEntry
impl Send for SegmentEntry
impl Sync for SegmentEntry
impl Unpin for SegmentEntry
impl UnsafeUnpin for SegmentEntry
impl UnwindSafe for SegmentEntry
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more