pub trait FileStore {
// Required methods
fn get_native_path<P: AsRef<Utf8Path>>(&self, path: P) -> Utf8PathBuf;
fn create_directory<P: AsRef<Utf8Path>>(
&self,
path: P,
) -> FileStoreResult<()>;
fn remove_directory<P: AsRef<Utf8Path>>(
&self,
path: P,
) -> FileStoreResult<()>;
fn create_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>;
fn delete_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>;
fn open<P: AsRef<Utf8Path>>(
&self,
path: P,
options: &mut OpenOptions,
) -> FileStoreResult<File>;
fn open_tempfile(&self) -> FileStoreResult<File>;
fn get_size<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<u64>;
}Expand description
Defines any necessary actions a CFDP File Store implementation must perform. Assumes any FileStore has a root path it operates relative to.
Required Methods§
Sourcefn 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.
Sourcefn create_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn create_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
Creates the directory Relative to the root path.
Sourcefn remove_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn remove_directory<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
Remove a directory Relative to the root path.
Sourcefn create_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn create_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
Creates a file relative to the root path.
Sourcefn delete_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
fn delete_file<P: AsRef<Utf8Path>>(&self, path: P) -> FileStoreResult<()>
Delete a file relative to the root path.
Sourcefn 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.
Sourcefn open_tempfile(&self) -> FileStoreResult<File>
fn open_tempfile(&self) -> FileStoreResult<File>
Opens a system temporary file
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".