pub struct Header {
pub version: (u8, u8),
pub dataset_type: DatasetType,
pub metadata_size: u32,
pub payload_size: u32,
pub uncompressed_size: u32,
pub compression: Compression,
pub flags: u8,
pub schema_size: u16,
pub num_rows: u64,
}Expand description
File header (32 bytes, fixed)
| Offset | Size | Field |
|---|---|---|
| 0 | 4 | magic |
| 4 | 2 | format_version (major.minor) |
| 6 | 2 | dataset_type |
| 8 | 4 | metadata_size |
| 12 | 4 | payload_size (compressed) |
| 16 | 4 | uncompressed_size |
| 20 | 1 | compression |
| 21 | 1 | flags |
| 22 | 2 | schema_size |
| 24 | 8 | num_rows |
Fields§
§version: (u8, u8)Format version (major, minor)
dataset_type: DatasetTypeDataset type identifier
metadata_size: u32Metadata block size in bytes
payload_size: u32Compressed payload size in bytes
uncompressed_size: u32Uncompressed payload size in bytes
compression: CompressionCompression algorithm
flags: u8Feature flags
schema_size: u16Schema block size in bytes
num_rows: u64Total row count
Implementations§
Source§impl Header
impl Header
Sourcepub fn new(dataset_type: DatasetType) -> Self
pub fn new(dataset_type: DatasetType) -> Self
Create a new header with default values
Sourcepub fn from_bytes(buf: &[u8]) -> Result<Self>
pub fn from_bytes(buf: &[u8]) -> Result<Self>
Deserialize header from bytes
§Errors
Returns error if magic is invalid, version is unsupported, or types are unknown.
Sourcepub const fn is_encrypted(&self) -> bool
pub const fn is_encrypted(&self) -> bool
Check if encrypted flag is set
Sourcepub const fn is_streaming(&self) -> bool
pub const fn is_streaming(&self) -> bool
Check if streaming flag is set
Sourcepub const fn is_licensed(&self) -> bool
pub const fn is_licensed(&self) -> bool
Check if licensed flag is set
Sourcepub const fn is_trueno_native(&self) -> bool
pub const fn is_trueno_native(&self) -> bool
Check if trueno-native flag is set
Trait Implementations§
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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> 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 moreCreates a shared type from an unshared type.