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