Struct FileIdentity
pub struct FileIdentity { /* private fields */ }std only.Expand description
Which file a path or handle names, and whether it changed.
On Unix it is device, inode, size, modification and change time; on Windows volume serial number, 128-bit file ID, size and last write time; elsewhere size and modification time. Two snapshots differ when any field differs, so a replacement with an older timestamp is a change too.
Build it with Self::of_path or Self::of_file. Self::from_metadata
has no file ID on Windows, so there it tells files apart by size and last
write time only, and that time advances in timer ticks (about 15.6 ms): a
same-size replacement renamed in within one tick looks unchanged. Only
compare identities built the same way.
A same-size in-place rewrite within one timestamp tick is not visible on any platform, nor is a same-size replacement within one tick on a Windows file system without file IDs (such as FAT).
Implementations§
§impl FileIdentity
impl FileIdentity
pub fn of_path(path: impl AsRef<Path>) -> Result<FileIdentity, Error>
pub fn of_path(path: impl AsRef<Path>) -> Result<FileIdentity, Error>
Snapshot the identity of the file path names now, following symlinks.
§Errors
Returns the I/O error of opening or querying path.
pub fn of_file(file: &File) -> Result<FileIdentity, Error>
pub fn of_file(file: &File) -> Result<FileIdentity, Error>
pub fn from_metadata(metadata: &Metadata) -> FileIdentity
pub fn from_metadata(metadata: &Metadata) -> FileIdentity
Snapshot the identity fields of metadata.
On Windows this leaves out the file ID, which metadata does not carry; see the type docs.
Trait Implementations§
§impl Clone for FileIdentity
impl Clone for FileIdentity
§fn clone(&self) -> FileIdentity
fn clone(&self) -> FileIdentity
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FileIdentity
§impl Debug for FileIdentity
impl Debug for FileIdentity
impl Eq for FileIdentity
§impl From<&Metadata> for FileIdentity
impl From<&Metadata> for FileIdentity
§fn from(metadata: &Metadata) -> FileIdentity
fn from(metadata: &Metadata) -> FileIdentity
§impl Hash for FileIdentity
impl Hash for FileIdentity
§impl PartialEq for FileIdentity
impl PartialEq for FileIdentity
impl StructuralPartialEq for FileIdentity
Auto Trait Implementations§
impl Freeze for FileIdentity
impl RefUnwindSafe for FileIdentity
impl Send for FileIdentity
impl Sync for FileIdentity
impl Unpin for FileIdentity
impl UnsafeUnpin for FileIdentity
impl UnwindSafe for FileIdentity
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more