pub struct FileStorage { /* private fields */ }Expand description
File-based storage backend
Implementations§
Source§impl FileStorage
impl FileStorage
Sourcepub fn new(base_path: impl AsRef<Path>) -> Result<Self>
pub fn new(base_path: impl AsRef<Path>) -> Result<Self>
Create a new file storage at the given path
Sourcepub fn set(&self, config: ConfigEntry) -> Result<()>
pub fn set(&self, config: ConfigEntry) -> Result<()>
Store a configuration
Sourcepub fn get(
&self,
namespace: &str,
key: &str,
env: Environment,
) -> Result<Option<ConfigEntry>>
pub fn get( &self, namespace: &str, key: &str, env: Environment, ) -> Result<Option<ConfigEntry>>
Get a configuration
Sourcepub fn list(
&self,
namespace: &str,
env: Environment,
) -> Result<Vec<ConfigEntry>>
pub fn list( &self, namespace: &str, env: Environment, ) -> Result<Vec<ConfigEntry>>
List all configurations in a namespace
Sourcepub fn delete(
&self,
namespace: &str,
key: &str,
env: Environment,
) -> Result<bool>
pub fn delete( &self, namespace: &str, key: &str, env: Environment, ) -> Result<bool>
Delete a configuration
Sourcepub fn store_version(&self, version: VersionEntry) -> Result<()>
pub fn store_version(&self, version: VersionEntry) -> Result<()>
Store a version entry
Sourcepub fn get_versions(
&self,
namespace: &str,
key: &str,
env: Environment,
) -> Result<Vec<VersionEntry>>
pub fn get_versions( &self, namespace: &str, key: &str, env: Environment, ) -> Result<Vec<VersionEntry>>
Get version history for a config
Trait Implementations§
Source§impl Clone for FileStorage
impl Clone for FileStorage
Source§fn clone(&self) -> FileStorage
fn clone(&self) -> FileStorage
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto 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