pub struct FileOps;Implementations§
Source§impl FileOps
impl FileOps
pub fn ensure_dir(&self, path: impl AsRef<Path>) -> Result<(), Error>
pub fn read(&self, path: impl AsRef<Path>) -> Result<Vec<u8>, Error>
pub fn read_to_string(&self, path: impl AsRef<Path>) -> Result<String, Error>
pub fn write( &self, path: impl AsRef<Path>, contents: impl AsRef<[u8]>, ) -> Result<(), Error>
pub fn append( &self, path: impl AsRef<Path>, contents: impl AsRef<[u8]>, ) -> Result<(), Error>
pub fn contains( &self, path: impl AsRef<Path>, pattern: &str, ) -> Result<bool, Error>
Auto Trait Implementations§
impl Freeze for FileOps
impl RefUnwindSafe for FileOps
impl Send for FileOps
impl Sync for FileOps
impl Unpin for FileOps
impl UnsafeUnpin 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