pub struct WriteSession<'a, S: Store> { /* private fields */ }Expand description
Bounded mutable view over an immutable base tree.
Implementations§
Source§impl<'a, S: Store> WriteSession<'a, S>
impl<'a, S: Store> WriteSession<'a, S>
pub fn new(manager: &'a Prolly<S>, base: Tree, max_bytes: usize) -> Self
pub fn base(&self) -> &Tree
pub fn pending_bytes(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn put(&mut self, key: Vec<u8>, value: Vec<u8>) -> Result<(), Error>
pub fn delete(&mut self, key: Vec<u8>) -> Result<(), Error>
pub fn get(&self, key: &[u8]) -> Result<Option<Vec<u8>>, Error>
Sourcepub fn range(
&self,
start: &[u8],
end: Option<&[u8]>,
) -> Result<Vec<KeyValue>, Error>
pub fn range( &self, start: &[u8], end: Option<&[u8]>, ) -> Result<Vec<KeyValue>, Error>
Materialize one bounded merged range from the base cursor and overlay.
pub fn savepoint(&self) -> Savepoint
pub fn revert(&mut self, savepoint: Savepoint) -> Result<(), Error>
Auto Trait Implementations§
impl<'a, S> Freeze for WriteSession<'a, S>
impl<'a, S> RefUnwindSafe for WriteSession<'a, S>where
S: RefUnwindSafe,
impl<'a, S> Send for WriteSession<'a, S>
impl<'a, S> Sync for WriteSession<'a, S>
impl<'a, S> Unpin for WriteSession<'a, S>
impl<'a, S> UnsafeUnpin for WriteSession<'a, S>
impl<'a, S> UnwindSafe for WriteSession<'a, S>where
S: RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more