Struct encrypted_json_kv::Database [−][src]
A KV store based on sled, storing serde_json::Value values in an encrypted fashion
Implementations
impl Database
[src]
pub fn new(path: PathBuf, passphrase: &[u8]) -> Result<Self, DatabaseOpenError>
[src]
Opens a new Database instance.
pub fn temporary() -> Result<Self, DatabaseOpenError>
[src]
Opens a new temporary Database instance
pub fn set_passphrase(
&self,
passphrase: &[u8]
) -> Result<(), DatabaseSetPassphraseError>
[src]
&self,
passphrase: &[u8]
) -> Result<(), DatabaseSetPassphraseError>
pub fn get(&self, key: &str) -> Result<Option<Value>, DatabaseError>
[src]
Get a serde_json::Value from the database. The wrapping sled::Result will only throw an error when something goes really wrong. The Option inside that Result indicates whether the requested item is present
pub fn insert(&self, key: &str, value: &Value) -> Result<(), DatabaseError>
[src]
Insert a serde_json::Value into the database. The wrapping sled::Result will only throw an error when something goes really wrong. The Option inside contains the ciphertext of the just inserted value, if this insertion was successful.
pub fn remove(&self, key: &str) -> Result<Option<Value>, DatabaseError>
[src]
Remove a value from the database. The wrapping sled::Result will only throw an error when something goes really wrong. The Option inside contains the old value, if one was present.
pub fn keys(&self) -> impl DoubleEndedIterator<Item = Result<IVec>>
[src]
Iterate over all keys in the database
pub fn encryption_key(&self) -> &Key
[src]
Get encryption key
Auto Trait Implementations
impl !RefUnwindSafe for Database
[src]
impl Send for Database
[src]
impl Sync for Database
[src]
impl Unpin for Database
[src]
impl !UnwindSafe for Database
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,