pub struct FileOps;Expand description
Implement FileOperations for a unit struct to enable trait usage
Trait Implementations§
Source§impl FileOperations for FileOps
impl FileOperations for FileOps
Source§fn read_file_with_context(path: impl AsRef<Path>) -> Result<String>
fn read_file_with_context(path: impl AsRef<Path>) -> Result<String>
Read a file with appropriate error context
Source§fn write_file_with_context(
path: impl AsRef<Path>,
content: impl AsRef<str>,
) -> Result<()>
fn write_file_with_context( path: impl AsRef<Path>, content: impl AsRef<str>, ) -> Result<()>
Write to a file with appropriate error context
Source§fn create_dir_with_context(path: impl AsRef<Path>) -> Result<()>
fn create_dir_with_context(path: impl AsRef<Path>) -> Result<()>
Create a directory with appropriate error context
Source§fn read_bytes_with_context(path: impl AsRef<Path>) -> Result<Vec<u8>>
fn read_bytes_with_context(path: impl AsRef<Path>) -> Result<Vec<u8>>
Read a file as bytes with appropriate error context
Source§fn write_bytes_with_context(
path: impl AsRef<Path>,
content: impl AsRef<[u8]>,
) -> Result<()>
fn write_bytes_with_context( path: impl AsRef<Path>, content: impl AsRef<[u8]>, ) -> Result<()>
Write bytes to a file with appropriate error context
Source§fn copy_file_with_context(
from: impl AsRef<Path>,
to: impl AsRef<Path>,
) -> Result<u64>
fn copy_file_with_context( from: impl AsRef<Path>, to: impl AsRef<Path>, ) -> Result<u64>
Copy a file with appropriate error context
Source§fn remove_file_with_context(path: impl AsRef<Path>) -> Result<()>
fn remove_file_with_context(path: impl AsRef<Path>) -> Result<()>
Remove a file with appropriate error context
Auto Trait Implementations§
impl Freeze for FileOps
impl RefUnwindSafe for FileOps
impl Send for FileOps
impl Sync for FileOps
impl Unpin for FileOps
impl UnwindSafe for FileOps
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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