pub struct SegmentHeader {
pub version: u16,
pub flags: u16,
pub created_at: i64,
pub min_timestamp: i64,
pub max_timestamp: i64,
pub row_count: u64,
pub column_count: u16,
pub series_count: u32,
pub compression: u8,
pub sort_order: u8,
}Expand description
Segment file header.
Fields§
§version: u16Format version.
flags: u16Flags (reserved for future use).
created_at: i64Creation timestamp (nanoseconds since epoch).
min_timestamp: i64Minimum timestamp across all rows in the segment.
max_timestamp: i64Maximum timestamp across all rows in the segment.
row_count: u64Total number of rows in the segment.
column_count: u16Number of columns (including timestamp).
series_count: u32Number of unique series in the segment.
compression: u8Compression codec: 0 = LZ4, 1 = Zstd, 2 = None.
sort_order: u8Sort order: 0 = unsorted, 1 = by series+timestamp.
Implementations§
Source§impl SegmentHeader
impl SegmentHeader
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Deserialize a header from bytes.
§Errors
Returns SegmentError::InvalidMagic if magic bytes don’t match,
or SegmentError::UnsupportedVersion if version is not supported.
Trait Implementations§
Source§impl Clone for SegmentHeader
impl Clone for SegmentHeader
Source§fn clone(&self) -> SegmentHeader
fn clone(&self) -> SegmentHeader
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 moreSource§impl Debug for SegmentHeader
impl Debug for SegmentHeader
impl Eq for SegmentHeader
Source§impl PartialEq for SegmentHeader
impl PartialEq for SegmentHeader
impl StructuralPartialEq for SegmentHeader
Auto Trait Implementations§
impl Freeze for SegmentHeader
impl RefUnwindSafe for SegmentHeader
impl Send for SegmentHeader
impl Sync for SegmentHeader
impl Unpin for SegmentHeader
impl UnsafeUnpin for SegmentHeader
impl UnwindSafe for SegmentHeader
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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§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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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