pub struct Db { /* private fields */ }
Implementations§
source§impl Db
impl Db
pub fn flush(&self) -> Result<(), Error>
pub fn open<P: AsRef<Path>>(path: P) -> Result<Self, Error>
pub fn writer(&self) -> Result<Writer<'_>, Error>
pub fn reader(&self) -> Result<Reader<'_>, Error>
pub fn commit<T: Transaction>(&self, txn: T) -> Result<(), Error>
pub fn put<E: AsRef<Event>>( &self, writer: &mut Writer<'_>, event: E ) -> Result<CheckEventResult, Error>
pub fn get<R: FromEventData, K: AsRef<[u8]>, T: Transaction>( &self, txn: &T, event_id: K ) -> Result<Option<R>, Error>
pub fn del<K: AsRef<[u8]>>( &self, writer: &mut Writer<'_>, event_id: K ) -> Result<bool, Error>
pub fn batch_put<II, N>(&self, events: II) -> Result<usize, Error>where II: IntoIterator<Item = N>, N: AsRef<Event>,
pub fn batch_get<R: FromEventData, II, N>( &self, event_ids: II ) -> Result<Vec<R>, Error>where II: IntoIterator<Item = N>, N: AsRef<[u8]>,
pub fn batch_del<II, N>(&self, event_ids: II) -> Result<(), Error>where II: IntoIterator<Item = N>, N: AsRef<[u8]>,
pub fn iter<'txn, J: FromEventData, T: Transaction>( &self, txn: &'txn T, filter: &Filter ) -> Result<Iter<'txn, T, J>, Error>
pub fn iter_expiration<'txn, J: FromEventData, T: Transaction>( &self, txn: &'txn T, until: Option<u64> ) -> Result<Iter<'txn, T, J>, Error>
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Db
impl Send for Db
impl Sync for Db
impl Unpin for Db
impl !UnwindSafe for Db
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
source§impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.