pub struct FileStates { /* private fields */ }Expand description
The file states and hashes of one build, shared by every thread.
Implementations§
Source§impl FileStates
impl FileStates
Sourcepub fn new(pool: WorkerPool) -> Self
pub fn new(pool: WorkerPool) -> Self
An empty cache, whose hashing and parallel work run on pool.
Sourcepub const fn pool(&self) -> &WorkerPool
pub const fn pool(&self) -> &WorkerPool
The pool that runs the build’s parallel work.
Sourcepub fn files_hashed(&self) -> u64
pub fn files_hashed(&self) -> u64
The number of files whose content was hashed so far.
Sourcepub fn hash(&self, path: &Path, meta: &FileMeta) -> Result<ContentHash>
pub fn hash(&self, path: &Path, meta: &FileMeta) -> Result<ContentHash>
The hash of the content of the regular file at path, whose current
metadata is meta: the cached hash when the cache holds one for path with
the same metadata, otherwise a new hash, which the cache then keeps.
§Errors
Returns the error of reading the file.
Sourcepub fn hash_uncached(&self, path: &Path) -> Result<ContentHash>
pub fn hash_uncached(&self, path: &Path) -> Result<ContentHash>
The hash of the content of the file at path, read now, without the cache.
§Errors
Returns the error of reading the file.
Sourcepub fn clear(&self)
pub fn clear(&self)
Forget all cached file hashes after a command whose writes were not observed.
Sourcepub fn forget_written(&self, accesses: &Accesses)
pub fn forget_written(&self, accesses: &Accesses)
Drop the entry of every path that accesses records a write to.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileStates
impl !RefUnwindSafe for FileStates
impl !UnwindSafe for FileStates
impl Send for FileStates
impl Sync for FileStates
impl Unpin for FileStates
impl UnsafeUnpin for FileStates
Blanket Implementations§
impl<T> AsTypeStaticRegistered for T
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> HasTyVTable for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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