pub struct Reader {
pub header: Header,
/* private fields */
}Fields§
§header: HeaderImplementations§
Source§impl Reader
impl Reader
pub fn open(path: &Path) -> Result<Self>
pub fn get_last_modified(root: &Path) -> Result<u64>
pub fn get_trigram(&self, trigram: Trigram) -> Option<TrigramInfo>
pub fn decode_postings(&self, info: &TrigramInfo) -> Result<PostingList>
pub fn get_file(&self, file_id: u32) -> Result<FileInfo>
pub fn bloom_may_contain(&self, file_id: u32, trigram: Trigram) -> bool
pub fn metadata(&self) -> ShardMetadata
Sourcepub fn is_stale(&self, path: &Path) -> bool
pub fn is_stale(&self, path: &Path) -> bool
Detect whether the shard file on disk has been rebuilt under this live mmap.
Returns true if the inode or file size differs, or if the file no longer exists.
A stale reader should be dropped and reopened.
On Unix: uses inode comparison (inode changes on atomic rename). On non-Unix: uses file size comparison only (Windows file locking prevents rebuild under live mmap, so size-only detection is sufficient).
Auto Trait Implementations§
impl Freeze for Reader
impl RefUnwindSafe for Reader
impl Send for Reader
impl Sync for Reader
impl Unpin for Reader
impl UnsafeUnpin for Reader
impl UnwindSafe for Reader
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> 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