Struct transact::database::lmdb::LmdbDatabaseWriter
source · pub struct LmdbDatabaseWriter<'a> { /* private fields */ }
Trait Implementations§
source§impl<'a> DatabaseReader for LmdbDatabaseWriter<'a>
impl<'a> DatabaseReader for LmdbDatabaseWriter<'a>
source§fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, DatabaseError>
fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, DatabaseError>
Returns the bytes stored at the given key, if found.
source§fn index_get(
&self,
index: &str,
key: &[u8]
) -> Result<Option<Vec<u8>>, DatabaseError>
fn index_get( &self, index: &str, key: &[u8] ) -> Result<Option<Vec<u8>>, DatabaseError>
Returns the bytes stored at the given key on a specified index, if found.
source§fn cursor(&self) -> Result<DatabaseCursor<'_>, DatabaseError>
fn cursor(&self) -> Result<DatabaseCursor<'_>, DatabaseError>
Returns a cursor against the main database. The cursor iterates over
the entries in the natural key order.
source§fn index_cursor(&self, index: &str) -> Result<DatabaseCursor<'_>, DatabaseError>
fn index_cursor(&self, index: &str) -> Result<DatabaseCursor<'_>, DatabaseError>
Returns a cursor against the given index. The cursor iterates over
the entries in the index’s natural key order.
source§fn count(&self) -> Result<usize, DatabaseError>
fn count(&self) -> Result<usize, DatabaseError>
Returns the number of entries in the main database.
source§fn index_count(&self, index: &str) -> Result<usize, DatabaseError>
fn index_count(&self, index: &str) -> Result<usize, DatabaseError>
Returns the number of entries in the given index.
source§impl<'a> DatabaseWriter for LmdbDatabaseWriter<'a>
impl<'a> DatabaseWriter for LmdbDatabaseWriter<'a>
source§fn put(&mut self, key: &[u8], value: &[u8]) -> Result<(), DatabaseError>
fn put(&mut self, key: &[u8], value: &[u8]) -> Result<(), DatabaseError>
Writes the given key/value pair. If the key/value pair already exists, it will return a DatabaseError::DuplicateEntry.
source§fn overwrite(&mut self, key: &[u8], value: &[u8]) -> Result<(), DatabaseError>
fn overwrite(&mut self, key: &[u8], value: &[u8]) -> Result<(), DatabaseError>
Writes the given key/value pair. If the key/value pair already exists,
it overwrites the old value
source§fn delete(&mut self, key: &[u8]) -> Result<(), DatabaseError>
fn delete(&mut self, key: &[u8]) -> Result<(), DatabaseError>
Deletes the given key/value pair. If the key does exist, it returns an error,
source§fn index_put(
&mut self,
index: &str,
key: &[u8],
value: &[u8]
) -> Result<(), DatabaseError>
fn index_put( &mut self, index: &str, key: &[u8], value: &[u8] ) -> Result<(), DatabaseError>
Writes the given key/value pair at index.
source§fn index_delete(&mut self, index: &str, key: &[u8]) -> Result<(), DatabaseError>
fn index_delete(&mut self, index: &str, key: &[u8]) -> Result<(), DatabaseError>
Deletes the given key/value pair at index.
fn commit(self: Box<Self>) -> Result<(), DatabaseError>
fn as_reader(&self) -> &dyn DatabaseReader
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for LmdbDatabaseWriter<'a>
impl<'a> !Send for LmdbDatabaseWriter<'a>
impl<'a> !Sync for LmdbDatabaseWriter<'a>
impl<'a> Unpin for LmdbDatabaseWriter<'a>
impl<'a> !UnwindSafe for LmdbDatabaseWriter<'a>
Blanket Implementations§
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoSql for T
impl<T> IntoSql for T
source§fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
fn into_sql<T>(self) -> Self::Expressionwhere
Self: AsExpression<T> + Sized,
Convert
self
to an expression for Diesel’s query builder. Read moresource§fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
fn as_sql<'a, T>(&'a self) -> <&'a Self as AsExpression<T>>::Expressionwhere
&'a Self: AsExpression<T>,
Convert
&self
to an expression for Diesel’s query builder. Read more§impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
impl<T> SafeBorrow<T> for Twhere
T: ?Sized,
§fn borrow_replacement(ptr: &T) -> &T
fn borrow_replacement(ptr: &T) -> &T
Given
ptr
, which was obtained from a prior call to Self::borrow()
,
return a value with the same nominal lifetime which is guaranteed to
survive mutations to Self
. Read more