pub struct NativeFileStore { /* private fields */ }Expand description
Store the root path information for a FileStore implementation using built in rust std::fs interface.
Implementations§
Trait Implementations§
Source§impl FileStore for NativeFileStore
impl FileStore for NativeFileStore
Source§fn create_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn create_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
This is a wrapper around fs::create_dir
Source§fn remove_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn remove_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
This function wraps fs::remove_dir_all
Source§fn create_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn create_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
This is a wrapper around File::create
Source§fn delete_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn delete_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
This is a wrapper around fs::remove_file
Source§fn open_tempfile(&self) -> FileStoreResult<File>
fn open_tempfile(&self) -> FileStoreResult<File>
This is an alias for tempfile::tempfile
Source§fn get_size<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<u64>
fn get_size<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<u64>
This function uses fs::metadata to read the size of the input file relative to the root path.
Source§fn get_native_path<P: AsRef<Utf8Path>>(&self, path: P) -> Utf8PathBuf
fn get_native_path<P: AsRef<Utf8Path>>(&self, path: P) -> Utf8PathBuf
Returns the path to the target with the root path prepended.
Used when manipulating the filesystem relative to the root path.
Source§fn open<P: AsRef<Utf8Path>>(
&self,
path: P,
options: &mut OpenOptions,
) -> FileStoreResult<File>
fn open<P: AsRef<Utf8Path>>( &self, path: P, options: &mut OpenOptions, ) -> FileStoreResult<File>
Opens a file relative to the root path with the given options.
Auto Trait Implementations§
impl Freeze for NativeFileStore
impl RefUnwindSafe for NativeFileStore
impl Send for NativeFileStore
impl Sync for NativeFileStore
impl Unpin for NativeFileStore
impl UnsafeUnpin for NativeFileStore
impl UnwindSafe for NativeFileStore
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