pub struct VectorSegment<'s> { /* private fields */ }Expand description
The vector sections of one open segment.
Implementations§
Source§impl<'s> VectorSegment<'s>
impl<'s> VectorSegment<'s>
Sourcepub fn open(segment: &'s Segment) -> Result<Option<Self>, SegmentError>
pub fn open(segment: &'s Segment) -> Result<Option<Self>, SegmentError>
The segment’s vector sections, or None when it has none. Opening
reads every scan row once, to check the values each search relies on.
§Errors
When the segment has only some of them, or they are malformed.
Sourcepub fn parts(&self) -> VectorSegmentParts
pub fn parts(&self) -> VectorSegmentParts
What this open read and checked, to reopen the same
open segment later at no cost.
Sourcepub fn reopen(segment: &'s Segment, parts: &VectorSegmentParts) -> Option<Self>
pub fn reopen(segment: &'s Segment, parts: &VectorSegmentParts) -> Option<Self>
The vector sections of segment as an earlier open
of this same open segment found them, without reading or checking
anything again. None when parts came from another open segment,
even one of the same file.
pub fn segment(&self) -> &'s Segment
pub fn model(&self) -> &ModelIdentity
pub fn dimensions(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn chunk_map_count(&self) -> u32
pub fn chunk_map_count(&self) -> u32
How many chunk maps the segment holds.
Sourcepub fn section_bytes(&self) -> SectionBytes
pub fn section_bytes(&self) -> SectionBytes
Bytes of the segment’s vector sections, for size reports.
Sourcepub fn chunk_map_keys(&self) -> Result<Vec<ChunkMapKey>, SegmentError>
pub fn chunk_map_keys(&self) -> Result<Vec<ChunkMapKey>, SegmentError>
Sourcepub fn texts(&self) -> Result<Vec<TextDigest>, SegmentError>
pub fn texts(&self) -> Result<Vec<TextDigest>, SegmentError>
Sourcepub fn find(&self, text: TextDigest) -> Result<Option<u32>, SegmentError>
pub fn find(&self, text: TextDigest) -> Result<Option<u32>, SegmentError>
Sourcepub fn vector(&self, ordinal: u32) -> Result<Vec<f32>, SegmentError>
pub fn vector(&self, ordinal: u32) -> Result<Vec<f32>, SegmentError>
The stored f32 vector at ordinal, exactly as it was written.
§Errors
When a read fails or a block fails its checksum.
Sourcepub fn chunk_map(
&self,
content: ContentKey,
path: &[u8],
) -> Result<Option<Vec<Chunk>>, SegmentError>
pub fn chunk_map( &self, content: ContentKey, path: &[u8], ) -> Result<Option<Vec<Chunk>>, SegmentError>
The chunk map of the file at path with content, if the segment
has one.
§Errors
When a read fails or the map is malformed.
Sourcepub fn chunk_map_at(&self, ordinal: u32) -> Result<Vec<Chunk>, SegmentError>
pub fn chunk_map_at(&self, ordinal: u32) -> Result<Vec<Chunk>, SegmentError>
The chunks at ordinal, in the same order as Self::chunk_map_keys.
§Errors
When a read fails, the ordinal is out of range, or the map is malformed.
Sourcepub fn chunk_details(
&self,
content: ContentKey,
path: &[u8],
) -> Result<Option<FileDetails>, SegmentError>
pub fn chunk_details( &self, content: ContentKey, path: &[u8], ) -> Result<Option<FileDetails>, SegmentError>
The details recorded with the chunk map of the file at path with
content: None when the segment has no such map, or the map was
added without details.
§Errors
When a read fails, or the details are malformed or do not describe the map’s chunks.