[][src]Struct grin_store::Store

pub struct Store { /* fields omitted */ }

LMDB-backed store facilitating data access and serialization. All writes are done through a Batch abstraction providing atomicity.

Methods

impl Store[src]

pub fn open(env: Arc<Environment>, name: &str) -> Store[src]

Creates a new store with the provided name under the specified environment

pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>[src]

Gets a value from the db, provided its 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. Encapsulates serialization.

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 batch(&self) -> Result<Batch, Error>[src]

Builds a new batch to be used with this store.

Auto Trait Implementations

impl Send for Store

impl Sync for Store

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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.

impl<T> UnsafeAny for T where
    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