Struct tantivy::Segment
[−]
[src]
pub struct Segment { /* fields omitted */ }
A segment is a piece of the index.
Methods
impl Segment
[src]
fn schema(&self) -> Schema
Returns our index's schema.
fn meta(&self) -> &SegmentMeta
Returns the segment meta-information
fn id(&self) -> SegmentId
Returns the segment's id.
fn relative_path(&self, component: SegmentComponent) -> PathBuf
Returns the relative path of a component of our segment.
It just joins the segment id with the extension associated to a segment component.
fn protect_from_delete(&self, component: SegmentComponent) -> FileProtection
Protects a specific component file from being deleted.
Returns a FileProtection object. The file is guaranteed
to not be garbage collected as long as this FileProtection
object
lives.
fn open_read(
&self,
component: SegmentComponent
) -> Result<ReadOnlySource, OpenReadError>
&self,
component: SegmentComponent
) -> Result<ReadOnlySource, OpenReadError>
Open one of the component file for a regular read.
fn open_write(
&mut self,
component: SegmentComponent
) -> Result<WritePtr, OpenWriteError>
&mut self,
component: SegmentComponent
) -> Result<WritePtr, OpenWriteError>
Open one of the component file for regular write.
Trait Implementations
impl Clone for Segment
[src]
fn clone(&self) -> Segment
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more