pub struct Segment {
pub metadata: SegmentMetadata,
/* private fields */
}Expand description
A segment containing vectors
Fields§
§metadata: SegmentMetadataSegment metadata
Implementations§
Source§impl Segment
impl Segment
Sourcepub fn new(id: SegmentId, namespace: NamespaceId) -> Self
pub fn new(id: SegmentId, namespace: NamespaceId) -> Self
Create a new segment
Sourcepub fn delete(&mut self, id: &VectorId) -> bool
pub fn delete(&mut self, id: &VectorId) -> bool
Delete a vector from the segment (mark as tombstone)
Sourcepub fn is_tombstoned(&self, id: &VectorId) -> bool
pub fn is_tombstoned(&self, id: &VectorId) -> bool
Check if a vector is tombstoned
Sourcepub fn live_vectors(&self) -> impl Iterator<Item = &Vector>
pub fn live_vectors(&self) -> impl Iterator<Item = &Vector>
Get all live vectors
Sourcepub fn all_ids(&self) -> impl Iterator<Item = &VectorId>
pub fn all_ids(&self) -> impl Iterator<Item = &VectorId>
Get all vector IDs (including tombstoned)
Sourcepub fn tombstone_ids(&self) -> impl Iterator<Item = &VectorId>
pub fn tombstone_ids(&self) -> impl Iterator<Item = &VectorId>
Get tombstone IDs
Sourcepub fn mark_compacting(&mut self)
pub fn mark_compacting(&mut self)
Mark as compacting
Sourcepub fn mark_tombstone(&mut self)
pub fn mark_tombstone(&mut self)
Mark for deletion
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§
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<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