pub struct FileStorage { /* private fields */ }
Implementations§
Source§impl FileStorage
impl FileStorage
pub fn new<P: AsRef<Path>>( path: P, if_directory_missing: IfDirectoryMissing, ) -> Result<Self, Error>
pub fn next_to_exe<P: AsRef<Path>>( relative_path: P, if_directory_missing: IfDirectoryMissing, ) -> Result<Self, Error>
pub fn full_path<S: AsRef<str>>(&self, path: S) -> PathBuf
pub fn temp<P: AsRef<Path>>( relative_path: P, if_directory_missing: IfDirectoryMissing, ) -> Result<Self, Error>
Trait Implementations§
Source§impl Storage for FileStorage
impl Storage for FileStorage
fn exists<K>(&self, key: K) -> bool
fn clear(&mut self)
fn remove<K>(&mut self, key: K) -> Result<(), RemoveError>
fn load_raw<K>(&self, key: K) -> Result<Vec<u8>, LoadRawError>
fn store_raw<K, V>(&mut self, key: K, value: V) -> Result<(), StoreRawError>
fn load<K, T, F>( &self, key: K, format: F, ) -> Result<T, LoadError<<F as StorageFormat>::DeserializeError>>
fn store<K, T, F>( &mut self, key: K, value: &T, format: F, ) -> Result<(), StoreError<<F as StorageFormat>::SerializeError>>
Auto Trait Implementations§
impl Freeze for FileStorage
impl RefUnwindSafe for FileStorage
impl Send for FileStorage
impl Sync for FileStorage
impl Unpin for FileStorage
impl UnwindSafe for FileStorage
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