pub struct Segment { /* private fields */ }Expand description
An immutable segment backed by mmap
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn header(&self) -> &SegmentHeader
pub fn header(&self) -> &SegmentHeader
Get segment header
Sourcepub fn num_vectors(&self) -> u32
pub fn num_vectors(&self) -> u32
Number of vectors
Sourcepub fn get_i8_vector(&self, vid: VectorId) -> Option<&[i8]>
pub fn get_i8_vector(&self, vid: VectorId) -> Option<&[i8]>
Get int8 vector for a specific ID
Sourcepub fn scales_ptr(&self) -> *const f32
pub fn scales_ptr(&self) -> *const f32
Get raw pointer to quantization scales
Sourcepub fn scales_data(&self) -> &[f32]
pub fn scales_data(&self) -> &[f32]
Get quantization scales
Sourcepub fn outliers_ptr(&self) -> *const OutlierEntry
pub fn outliers_ptr(&self) -> *const OutlierEntry
Get raw pointer to outlier data
Sourcepub fn get_outliers(&self, vid: VectorId) -> Option<&[OutlierEntry]>
pub fn get_outliers(&self, vid: VectorId) -> Option<&[OutlierEntry]>
Get outliers for a specific vector
Sourcepub fn tombstone_ptr(&self) -> *const u64
pub fn tombstone_ptr(&self) -> *const u64
Get raw pointer to tombstone bitset
Sourcepub fn tombstone_data(&self) -> &[u64]
pub fn tombstone_data(&self) -> &[u64]
Get tombstone bitset
Sourcepub fn is_tombstoned(&self, vid: VectorId) -> bool
pub fn is_tombstoned(&self, vid: VectorId) -> bool
Check if a vector is tombstoned
Sourcepub fn rdf_directory(&self) -> &[PostingListEntry]
pub fn rdf_directory(&self) -> &[PostingListEntry]
Get RDF posting list directory
Sourcepub fn rdf_data_ptr(&self) -> *const u8
pub fn rdf_data_ptr(&self) -> *const u8
Get raw pointer to RDF posting list data
Sourcepub fn dim_weights(&self) -> &[f32]
pub fn dim_weights(&self) -> &[f32]
Get dimension weights for RDF
Sourcepub fn bps_qparams(&self) -> Option<&[BpsQParam]>
pub fn bps_qparams(&self) -> Option<&[BpsQParam]>
Get BPS quantization parameters (min, inv_range per slot).
Returns None if qparams were not stored (legacy segments).
The number of slots = num_bps_blocks × bps_proj.
Sourcepub fn get_fp32_vector(&self, vid: VectorId) -> Option<&[f32]>
pub fn get_fp32_vector(&self, vid: VectorId) -> Option<&[f32]>
Get fp32 vector for a specific ID
Sourcepub fn clone_mmap(&self) -> Arc<Mmap>
pub fn clone_mmap(&self) -> Arc<Mmap>
Clone the mmap handle (cheap, Arc-backed)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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> 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