pub struct FileAccess { /* private fields */ }Expand description
Tracked, confined access to the project’s files.
Implementations§
Source§impl FileAccess
impl FileAccess
Sourcepub fn new(root: &Path) -> FileAccess
pub fn new(root: &Path) -> FileAccess
Anchor reads at a project root, canonicalizing it.
Every containment check compares against the root, so it has to be canonical or a
symlinked checkout would fail every check. Callers that already hold a canonical
root should use FileAccess::rooted instead — this is one syscall, and the engine
builds an access per file.
Sourcepub fn rooted(root: PathBuf) -> FileAccess
pub fn rooted(root: PathBuf) -> FileAccess
Anchor reads at an already-canonical root.
Cheap enough to call per file, which is what the engine does: a fresh access per file makes it structurally impossible for one file’s reads to be recorded against another’s, rather than making it depend on a reset being called in the right place.
Sourcepub fn dependencies(&self) -> Vec<TrackedRead>
pub fn dependencies(&self) -> Vec<TrackedRead>
Everything read so far, in path order.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FileAccess
impl RefUnwindSafe for FileAccess
impl Send for FileAccess
impl Sync for FileAccess
impl Unpin for FileAccess
impl UnsafeUnpin for FileAccess
impl UnwindSafe for FileAccess
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