[][src]Struct sled::transaction::TransactionalTree

pub struct TransactionalTree { /* fields omitted */ }

A transaction that will be applied atomically to the Tree.

Implementations

impl TransactionalTree[src]

pub fn insert<K, V>(
    &self,
    key: K,
    value: V
) -> Result<Option<IVec>, UnabortableTransactionError> where
    K: AsRef<[u8]> + Into<IVec>,
    V: Into<IVec>, 
[src]

Set a key to a new value

pub fn remove<K>(
    &self,
    key: K
) -> Result<Option<IVec>, UnabortableTransactionError> where
    K: AsRef<[u8]> + Into<IVec>, 
[src]

Remove a key

pub fn get<K: AsRef<[u8]>>(
    &self,
    key: K
) -> Result<Option<IVec>, UnabortableTransactionError>
[src]

Get the value associated with a key

pub fn apply_batch(
    &self,
    batch: &Batch
) -> Result<(), UnabortableTransactionError>
[src]

Atomically apply multiple inserts and removals.

pub fn flush(&self)[src]

Flush the database before returning from the transaction.

pub fn generate_id(&self) -> Result<u64>[src]

Generate a monotonic ID. Not guaranteed to be contiguous or idempotent, can produce different values in the same transaction in case of conflicts. Written to disk every idgen_persist_interval operations, followed by a blocking flush. During recovery, we take the last recovered generated ID and add 2x the idgen_persist_interval to it. While persisting, if the previous persisted counter wasn't synced to disk yet, we will do a blocking flush to fsync the latest counter, ensuring that we will never give out the same counter twice.

Trait Implementations

impl Clone for TransactionalTree[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<T> Pointable for T[src]

type Init = T

The type for initializers.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.