pub struct SharedContext { /* private fields */ }Expand description
A RecallContext plus its layout fingerprint, with reopen-on-stale.
Implementations§
pub fn new(output_dir: PathBuf) -> Self
Sourcepub fn get(&mut self, config: &Config) -> Result<&mut RecallContext, String>
pub fn get(&mut self, config: &Config) -> Result<&mut RecallContext, String>
Get the context, opening or reopening as needed.
Reopen triggers: first use, meta.bin changed (rebuild), meta.bin
vanished, or the block count moved. One metadata() syscall per call
when warm (~1 us); a full reopen only when the layout actually changed.
Sourcepub fn invalidate(&mut self)
pub fn invalidate(&mut self)
Drop the held context, forcing a reopen on next use.
Call after operations known to replace the layout outside the
generation check’s view (there are currently none — build and
rebuild_pending both rewrite meta.bin — but the hook exists
so callers do not need to know that).
Auto Trait Implementations§
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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