[−][src]Struct grin_store::Batch
Batch to write multiple Writeables to db in an atomic manner.
Methods
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.
pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
[src]
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
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)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<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self
impl<T> SafeBorrow for T where
T: ?Sized,
T: ?Sized,