pub struct Version(/* private fields */);Expand description
An opaque token for “the state this entry was in when you looked”.
Returned by every read, stat and write; handed back as if_version to say “only if nothing changed”.
- An opaque equality token. Compare for equality, nothing else: the bytes mean different things per backend and are not stable across versions of this crate. Do not order, parse or persist one across an upgrade.
- Valid only against its own mount. A version taken from one mount means nothing to another:
Memorymakes every instance’s versions distinct, and aHostDirversion carries the file’s device and inode. Offered to the wrong mount it is aVersionMismatch, never a match. - A file’s version changes whenever its content is replaced (
HostDirderives it from mtime in nanoseconds, size, inode and device;Memoryfrom a counter). - A directory’s version changes at least whenever its set of entries changes (an entry added, removed or renamed in it). It may change more often (a backend is free to bump it for other reasons), so use it as “something may have changed, re-list”, never as “exactly these entries changed”. It does not promise to change when an entry’s content changes.
Implementations§
Trait Implementations§
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Forget for Version
impl Freeze for Version
impl Move for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnsafeUnpin for Version
impl UnwindSafe for Version
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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
Compare self to
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> ⓘ
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 moreCreates a shared type from an unshared type.