pub struct FileOps;Expand description
File I/O operations.
Implementations§
Source§impl FileOps
impl FileOps
Sourcepub fn write_file(path: &str, contents: &str) -> IoResult<()>
pub fn write_file(path: &str, contents: &str) -> IoResult<()>
Write a string to a file (overwrite).
Sourcepub fn write_file_bytes(path: &str, contents: &[u8]) -> IoResult<()>
pub fn write_file_bytes(path: &str, contents: &[u8]) -> IoResult<()>
Write bytes to a file (overwrite).
Sourcepub fn file_exists(path: &str) -> bool
pub fn file_exists(path: &str) -> bool
Check if a file exists.
Sourcepub fn delete_file(path: &str) -> IoResult<()>
pub fn delete_file(path: &str) -> IoResult<()>
Delete a file.
Sourcepub fn create_dir(path: &str) -> IoResult<()>
pub fn create_dir(path: &str) -> IoResult<()>
Create a directory (and parents).
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