pub struct Db { /* private fields */ }
Implementations§
Source§impl Db
impl Db
pub fn flush(&self) -> Result<(), Error>
Sourcepub fn check_schema(&self) -> Result<(), Error>
pub fn check_schema(&self) -> Result<(), Error>
check db version, return Error::VersionMismatch
when db schema changed
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>
pub fn batch_get<R: FromEventData, II, N>( &self, event_ids: II, ) -> Result<Vec<R>, Error>
pub fn batch_del<II, N>(&self, event_ids: II) -> Result<(), Error>
Sourcepub fn iter<'txn, J: FromEventData, T: Transaction>(
&self,
txn: &'txn T,
filter: &Filter,
) -> Result<Iter<'txn, T, J>, Error>
pub fn iter<'txn, J: FromEventData, T: Transaction>( &self, txn: &'txn T, filter: &Filter, ) -> Result<Iter<'txn, T, J>, Error>
iter events by filter
Sourcepub fn iter_expiration<'txn, J: FromEventData, T: Transaction>(
&self,
txn: &'txn T,
until: Option<u64>,
) -> 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>
iter expired events
Sourcepub fn iter_ephemeral<'txn, J: FromEventData, T: Transaction>(
&self,
txn: &'txn T,
until: Option<u64>,
) -> Result<Iter<'txn, T, J>, Error>
pub fn iter_ephemeral<'txn, J: FromEventData, T: Transaction>( &self, txn: &'txn T, until: Option<u64>, ) -> Result<Iter<'txn, T, J>, Error>
iter ephemeral events
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Db
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
Source§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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
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.