[−][src]Struct mdl::cache::Cache
LMDB cache. This struct implements the Store trait so it can be used to cache Model structs
Fields
env: Environment
LMDB environment
path: String
database path in the filesystem
Implementations
impl Cache
[src]
pub fn new(path: &str) -> Result<Cache, Error>
[src]
pub fn db(&self, name: &'static str) -> Result<Database, Error>
[src]
pub fn rw<F, T>(&self, db: &'static str, op: F) -> Result<T, Error> where
F: Fn(RwCursor<'_>) -> Result<T, Error>,
[src]
F: Fn(RwCursor<'_>) -> Result<T, Error>,
pub fn ro<F, T>(&self, db: &'static str, op: F) -> Result<T, Error> where
F: Fn(RoCursor<'_>) -> Result<T, Error>,
[src]
F: Fn(RoCursor<'_>) -> Result<T, Error>,
Trait Implementations
impl Store for Cache
[src]
fn push(&self, db: &'static str, key: &str, value: Vec<u8>) -> Result<(), Error>
[src]
fn pull<F, T>(
&self,
db: &'static str,
key: &str,
formatter: F
) -> Result<T, Error> where
F: Fn(&[u8]) -> Result<T, Error>,
[src]
&self,
db: &'static str,
key: &str,
formatter: F
) -> Result<T, Error> where
F: Fn(&[u8]) -> Result<T, Error>,
fn iter<F>(&self, db: &'static str, prefix: &str, f: F) -> Result<(), Error> where
F: Fn(&[u8]) -> Continue,
[src]
F: Fn(&[u8]) -> Continue,
fn rm(&self, db: &'static str, key: &str) -> Result<(), Error>
[src]
fn all<F, T>(
&self,
db: &'static str,
prefix: &str,
formatter: F
) -> Result<Vec<T>, Error> where
F: Fn(&[u8]) -> Result<T, Error>,
[src]
&self,
db: &'static str,
prefix: &str,
formatter: F
) -> Result<Vec<T>, Error> where
F: Fn(&[u8]) -> Result<T, Error>,
Auto Trait Implementations
impl !RefUnwindSafe for Cache
impl Send for Cache
impl !Sync for Cache
impl Unpin for Cache
impl UnwindSafe for Cache
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,
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.
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>,