pub struct CoListTransaction<S, V>{ /* private fields */ }Implementations§
Source§impl<S, V> CoListTransaction<S, V>
impl<S, V> CoListTransaction<S, V>
pub async fn get(&self, key: &CoListIndex) -> Result<Option<V>, StorageError>
pub async fn contains(&self, key: &CoListIndex) -> Result<bool, StorageError>
pub fn stream( &self, ) -> impl Stream<Item = Result<(CoListIndex, V), StorageError>> + '_
pub fn reverse_stream( &self, ) -> impl Stream<Item = Result<(CoListIndex, V), StorageError>> + '_
Sourcepub async fn insert(
&mut self,
index: CoListIndex,
value: V,
) -> Result<CoListIndex, StorageError>
pub async fn insert( &mut self, index: CoListIndex, value: V, ) -> Result<CoListIndex, StorageError>
Insert value after index shifting all elements after to the right.
Sourcepub async fn insert_before(
&mut self,
index: CoListIndex,
value: V,
) -> Result<CoListIndex, StorageError>
pub async fn insert_before( &mut self, index: CoListIndex, value: V, ) -> Result<CoListIndex, StorageError>
Insert value at index shifting all elements at or after to the right.
Sourcepub async fn set(
&mut self,
key: CoListIndex,
value: V,
) -> Result<(), StorageError>
pub async fn set( &mut self, key: CoListIndex, value: V, ) -> Result<(), StorageError>
Insert (set/replace) value to index.
Sourcepub async fn push(&mut self, value: V) -> Result<CoListIndex, StorageError>where
S: AnyBlockStorage,
pub async fn push(&mut self, value: V) -> Result<CoListIndex, StorageError>where
S: AnyBlockStorage,
Push as last value.
Sourcepub async fn pop(&mut self) -> Result<Option<(CoListIndex, V)>, StorageError>where
S: AnyBlockStorage,
pub async fn pop(&mut self) -> Result<Option<(CoListIndex, V)>, StorageError>where
S: AnyBlockStorage,
Pop last element.
Sourcepub async fn pop_front(
&mut self,
) -> Result<Option<(CoListIndex, V)>, StorageError>where
S: AnyBlockStorage,
pub async fn pop_front(
&mut self,
) -> Result<Option<(CoListIndex, V)>, StorageError>where
S: AnyBlockStorage,
Pop first element.
Sourcepub async fn remove(
&mut self,
key: CoListIndex,
) -> Result<Option<V>, StorageError>
pub async fn remove( &mut self, key: CoListIndex, ) -> Result<Option<V>, StorageError>
Remove given element and return the value.
Sourcepub async fn update_or_insert<F>(
&mut self,
key: CoListIndex,
update: F,
) -> Result<(), StorageError>
pub async fn update_or_insert<F>( &mut self, key: CoListIndex, update: F, ) -> Result<(), StorageError>
Update (or insert default) value.
Sourcepub async fn try_update_or_insert_async<F, Fut>(
&mut self,
key: CoListIndex,
update: F,
) -> Result<(), StorageError>
pub async fn try_update_or_insert_async<F, Fut>( &mut self, key: CoListIndex, update: F, ) -> Result<(), StorageError>
Update (or insert default) value.
Sourcepub async fn update<F>(
&mut self,
key: CoListIndex,
update: F,
) -> Result<(), StorageError>
pub async fn update<F>( &mut self, key: CoListIndex, update: F, ) -> Result<(), StorageError>
Update value, ignore if key not exists.
Sourcepub async fn try_update_async<F, Fut>(
&mut self,
key: CoListIndex,
update: F,
) -> Result<(), StorageError>
pub async fn try_update_async<F, Fut>( &mut self, key: CoListIndex, update: F, ) -> Result<(), StorageError>
Update value, ignore if key not exists.
Trait Implementations§
Source§impl<S, V> Clone for CoListTransaction<S, V>where
S: AnyBlockStorage + Clone,
V: Clone + Serialize + DeserializeOwned + Send + Sync + 'static + Clone,
impl<S, V> Clone for CoListTransaction<S, V>where
S: AnyBlockStorage + Clone,
V: Clone + Serialize + DeserializeOwned + Send + Sync + 'static + Clone,
Source§fn clone(&self) -> CoListTransaction<S, V>
fn clone(&self) -> CoListTransaction<S, V>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl<S, V> Freeze for CoListTransaction<S, V>where
S: Freeze,
impl<S, V> RefUnwindSafe for CoListTransaction<S, V>where
S: RefUnwindSafe,
V: RefUnwindSafe,
impl<S, V> Send for CoListTransaction<S, V>
impl<S, V> Sync for CoListTransaction<S, V>
impl<S, V> Unpin for CoListTransaction<S, V>
impl<S, V> UnsafeUnpin for CoListTransaction<S, V>where
S: UnsafeUnpin,
impl<S, V> UnwindSafe for CoListTransaction<S, V>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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