pub struct MegadexDb<T> { /* fields omitted */ }
A specialized database table that is persisted to the provided directory. This will store
structs which implement Serialize
and DeserializeOwned
. It will also index
those structs by any additional fields that you specify.
This is a sparse and rather specialized API as it is intended to be used with
the megadex_derive crate.
Fetch a handle to the underlying LMDB environment
Retrieve T from the database at the given id.
Returns None
if there is no value present for the id
Retrieve all objects that are indexed by the provided field
TODO This is ugly.. find a good way to refactor the handling of iterators of results of
options of values
pub fn get_ids_by_field<'s, K, I, Txn>( &self, reader: &Txn, name: &str, key: &'s K ) -> Result<Vec<I>, MegadexDbError> where K: Serialize, I: DeserializeOwned, Txn: Transaction, | [src] |
Retrieve the exact type of ids that are indexed by the provided field
XXX Note that this will basically swallow deserialization and mismatchd type errors by
simpling excluding the result from the vector if it fails
Retrieve an iterator for the raw bytes of ids that are indexed by the provided field
Store an object of type T indexed by id
Delete an object and all of its indexed fields.
Note that the obj, T
must be in the exact state in which it was put into the DB
for it to be successfully deleted.
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
🔬 This is a nightly-only experimental API. (try_from
)
The type returned in the event of a conversion error.
🔬 This is a nightly-only experimental API. (try_from
)
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static