pub struct RealFileLoader;Expand description
A FileLoader that uses std::fs to load real files.
Trait Implementations§
Source§impl FileLoader for RealFileLoader
impl FileLoader for RealFileLoader
Source§fn file_exists(&self, path: &Path) -> bool
fn file_exists(&self, path: &Path) -> bool
Query the existence of a file.
Source§fn read_file(&self, path: &Path) -> Result<String>
fn read_file(&self, path: &Path) -> Result<String>
Read the contents of a UTF-8 file into memory.
This function must return a String because we normalize
source files, which may require resizing.
Source§fn read_binary_file(&self, path: &Path) -> Result<Arc<[u8]>>
fn read_binary_file(&self, path: &Path) -> Result<Arc<[u8]>>
Read the contents of a potentially non-UTF-8 file into memory.
We don’t normalize binary files, so we can start in an Arc.
Source§fn current_directory(&self) -> Result<PathBuf>
fn current_directory(&self) -> Result<PathBuf>
Current working directory
Auto Trait Implementations§
impl DynSend for RealFileLoader
impl DynSync for RealFileLoader
impl Freeze for RealFileLoader
impl RefUnwindSafe for RealFileLoader
impl Send for RealFileLoader
impl Sync for RealFileLoader
impl Unpin for RealFileLoader
impl UnwindSafe for RealFileLoader
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§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>
§impl<T> IntoEither for T
impl<T> IntoEither for T
§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 more§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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 0 bytes