Struct persistentcache::storage::file::FileStorage
[−]
[src]
pub struct FileStorage { /* fields omitted */ }FileStorage struct
Methods
impl FileStorage[src]
pub fn new(path: &str) -> Result<Self, Error>[src]
Creates the path directory and returns a FileStorage struct.
Examples
use persistentcache::storage::file::FileStorage; let s = FileStorage::new(".example_dir").unwrap();
Trait Implementations
impl PersistentCache for FileStorage[src]
fn get(&self, name: &str) -> Result<Vec<u8>, Error>[src]
Returns the value corresponding to the variable name.
fn set(&self, name: &str, val: &[u8]) -> Result<(), Error>[src]
Writes the data of type &[u8] in array val to the file corresponding to the variable name.
fn flush(&self) -> Result<(), Error>[src]
Delete all variables stored in path (see new()) which start with PREFIX_.