pub struct Fs(/* private fields */);Expand description
A cheap-to-clone handle on a DirSource, with the std::fs-like calls readers use.
Implementations§
Source§impl Fs
impl Fs
Sourcepub fn dir_source(&self) -> &Arc<dyn DirSource> ⓘ
pub fn dir_source(&self) -> &Arc<dyn DirSource> ⓘ
The namespace this handle wraps.
Sourcepub fn open(&self, path: &Path) -> Result<SourceFile>
pub fn open(&self, path: &Path) -> Result<SourceFile>
Open a file (like std::fs::File::open).
Sourcepub fn find_in_dir(&self, dir: &Path, name: &str) -> Option<PathBuf>
pub fn find_in_dir(&self, dir: &Path, name: &str) -> Option<PathBuf>
The entry of dir named name as the directory lists it: an exact match first, else
one that differs only in ASCII case. Case-insensitive file systems (macOS, Windows)
would open dir/name either way; resolving through the listing reports the name the
file really has, identically on every file system and byte source.
Sourcepub fn read_to_string(&self, path: &Path) -> Result<String>
pub fn read_to_string(&self, path: &Path) -> Result<String>
Like std::fs::read_to_string.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Fs
impl !UnwindSafe for Fs
impl Freeze for Fs
impl Send for Fs
impl Sync for Fs
impl Unpin for Fs
impl UnsafeUnpin for Fs
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<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