#[repr(C)]pub struct SegmentHeader {Show 23 fields
pub magic: [u8; 8],
pub version: u32,
pub flags: SegmentFlags,
pub n_vec: u32,
pub dim: u32,
pub bps_block: u16,
pub bps_proj: u16,
pub rdf_t: u16,
pub rdf_stripe_shift: u8,
pub num_outliers: u8,
pub off_bps: u64,
pub off_i8: u64,
pub off_scales: u64,
pub off_outliers: u64,
pub off_tombstone: u64,
pub off_rdf_dir: u64,
pub off_rdf_data: u64,
pub off_dim_weights: u64,
pub off_fp32: u64,
pub off_bps_qparams: u64,
pub file_len: u64,
pub _reserved1: [u8; 128],
pub _reserved2: [u8; 8],
}Expand description
Segment header - fixed size at file start
Fields§
§magic: [u8; 8]Magic bytes: b“SVSEGM\0\0“
version: u32Format version
flags: SegmentFlagsFeature flags
n_vec: u32Number of vectors in segment
dim: u32Vector dimension
bps_block: u16BPS block size (e.g., 16)
bps_proj: u16BPS projections per block (1 or 2)
rdf_t: u16RDF top-t dimensions per vector
rdf_stripe_shift: u8RDF stripe shift (log2 of stripe size)
num_outliers: u8Number of outliers per vector
off_bps: u64BPS SoA array
off_i8: u64int8 embeddings (blocked SoA)
off_scales: u64Quantization scales per block
off_outliers: u64Outlier entries
off_tombstone: u64Tombstone bitset
off_rdf_dir: u64RDF posting list directory
off_rdf_data: u64RDF posting list data
off_dim_weights: u64Dimension weights for RDF
off_fp32: u64Original fp32 vectors (optional, for verification)
off_bps_qparams: u64BPS quantization parameters (min, inv_range per slot)
file_len: u64Total file length
_reserved1: [u8; 128]Padding for alignment (to 256 bytes total) 8 + 4 + 4 + 4 + 4 + 2 + 2 + 2 + 1 + 1 + (10 * 8) + 8 = 120, so we need 136 reserved
_reserved2: [u8; 8]Implementations§
Source§impl SegmentHeader
impl SegmentHeader
pub const SIZE: usize
Sourcepub fn num_bps_blocks(&self) -> u32
pub fn num_bps_blocks(&self) -> u32
Number of BPS blocks
Sourcepub fn stripe_size(&self) -> usize
pub fn stripe_size(&self) -> usize
Stripe size (number of vids per stripe)
Trait Implementations§
Source§impl Clone for SegmentHeader
impl Clone for SegmentHeader
Source§fn clone(&self) -> SegmentHeader
fn clone(&self) -> SegmentHeader
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SegmentHeader
Source§impl Debug for SegmentHeader
impl Debug for SegmentHeader
impl Pod 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
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
bits
as &Self.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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