pub struct DocumentEntry {
pub version: i32,
pub mtime: Option<SystemTime>,
pub size: Option<u64>,
pub content_hash: Option<[u8; 32]>,
}Expand description
Per-document state tracked for LSP synchronization.
We track mtime, size, and (for small files) a content hash so we can
detect when a file has been changed
outside the AFT pipeline (another tool, another session, manual edit) and
resync the LSP server before issuing diagnostic requests. Without this,
ensure_file_open would skip already-open files and return diagnostics
computed from stale in-memory content.
Fields§
§version: i32Monotonically increasing LSP version, starts at 0.
mtime: Option<SystemTime>Filesystem modification time at the moment we last synced this file
to the LSP server (didOpen or didChange). None if the file did not
exist on disk when we last synced (e.g. in-memory-only test fixtures
or files mid-rename).
size: Option<u64>Filesystem byte size at the moment we last synced. None for the
same reasons as mtime.
content_hash: Option<[u8; 32]>BLAKE3 content hash captured at the last sync for files up to
CONTENT_HASH_SIZE_LIMIT_BYTES. Large files skip hashing and rely on
(mtime, size) to avoid expensive reads.
Trait Implementations§
Source§impl Clone for DocumentEntry
impl Clone for DocumentEntry
Source§fn clone(&self) -> DocumentEntry
fn clone(&self) -> DocumentEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for DocumentEntry
impl RefUnwindSafe for DocumentEntry
impl Send for DocumentEntry
impl Sync for DocumentEntry
impl Unpin for DocumentEntry
impl UnsafeUnpin for DocumentEntry
impl UnwindSafe for DocumentEntry
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
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