[−][src]Struct grin_store::lmdb::Batch
Batch to write multiple Writeables to db in an atomic manner.
Implementations
impl<'a> Batch<'a>
[src]
pub fn put(&self, key: &[u8], value: &[u8]) -> Result<(), Error>
[src]
Writes a single key/value pair to the db
pub fn put_ser<W: Writeable>(&self, key: &[u8], value: &W) -> Result<(), Error>
[src]
Writes a single key and its Writeable
value to the db.
Encapsulates serialization using the (default) version configured on the store instance.
pub fn protocol_version(&self) -> ProtocolVersion
[src]
Protocol version used by this batch.
pub fn put_ser_with_version<W: Writeable>(
&self,
key: &[u8],
value: &W,
version: ProtocolVersion
) -> Result<(), Error>
[src]
&self,
key: &[u8],
value: &W,
version: ProtocolVersion
) -> Result<(), Error>
Writes a single key and its Writeable
value to the db.
Encapsulates serialization using the specified protocol version.
pub fn get_with<T, F>(&self, key: &[u8], f: F) -> Result<Option<T>, Error> where
F: Fn(&[u8]) -> T,
[src]
F: Fn(&[u8]) -> T,
gets a value from the db, provided its key
pub fn exists(&self, key: &[u8]) -> Result<bool, Error>
[src]
Whether the provided key exists
pub fn iter<T: Readable>(&self, from: &[u8]) -> Result<SerIterator<T>, Error>
[src]
Produces an iterator of Readable
types moving forward from the
provided key.
pub fn get_ser<T: Readable>(&self, key: &[u8]) -> Result<Option<T>, Error>
[src]
Gets a Readable
value from the db, provided its key, taking the
content of the current batch into account.
pub fn delete(&self, key: &[u8]) -> Result<(), Error>
[src]
Deletes a key/value pair from the db
pub fn commit(self) -> Result<(), Error>
[src]
Writes the batch to db
pub fn child(&mut self) -> Result<Batch<'_>, Error>
[src]
Creates a child of this batch. It will be merged with its parent on commit, abandoned otherwise.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for Batch<'a>
impl<'a> !Send for Batch<'a>
impl<'a> !Sync for Batch<'a>
impl<'a> Unpin for Batch<'a>
impl<'a> !UnwindSafe for Batch<'a>
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> SafeBorrow<T> for T where
T: ?Sized,
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
impl<T> Same<T> for T
type Output = T
Should always be Self
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> UnsafeAny for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,