pub enum Freshness {
Lazy,
Flag,
Strict,
}Expand description
How fresh the daemon’s answer must be relative to on-disk edits.
The daemon serves from a warm in-memory index kept current by a background
filesystem watcher (debounced). That is ideal for a human editor but leaves
a brief window in which an agent that edits a file and immediately queries
it can read a line number from the pre-edit index. Freshness lets a
caller trade latency for read-after-write guarantees on that boundary.
Variants§
Lazy
Serve straight from the warm index and rely on the watcher to catch up. Lowest latency; the default for human-facing and latency-sensitive calls.
Flag
Serve from the warm index but stat the tree first; if any indexed file
differs on disk, return the answer with Response::stale set so the
caller knows it may not reflect the most recent edits. Adds a stat-only
tree walk (no hashing, no reindex), so it stays fast.
Strict
Bring the index up to date with on-disk edits before answering, so the result reflects the current working tree (read-after-write). Costs a tree walk plus a reindex of whatever changed.
Trait Implementations§
impl Copy for Freshness
Source§impl<'de> Deserialize<'de> for Freshness
impl<'de> Deserialize<'de> for Freshness
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Freshness
impl StructuralPartialEq for Freshness
Auto Trait Implementations§
impl Freeze for Freshness
impl RefUnwindSafe for Freshness
impl Send for Freshness
impl Sync for Freshness
impl Unpin for Freshness
impl UnsafeUnpin for Freshness
impl UnwindSafe for Freshness
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> ⓘ
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> ⓘ
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