pub struct CoSet<K>(/* private fields */)
where
K: Hash + Ord + Clone + Send + Sync + 'static;Implementations§
Source§impl<K> CoSet<K>
impl<K> CoSet<K>
Sourcepub async fn from_iter<S>(
storage: &S,
iter: impl IntoIterator<Item = K>,
) -> Result<Self, StorageError>where
S: AnyBlockStorage,
pub async fn from_iter<S>(
storage: &S,
iter: impl IntoIterator<Item = K>,
) -> Result<Self, StorageError>where
S: AnyBlockStorage,
Create collection from iterator.
pub async fn contains<S>(
&self,
storage: &S,
key: &K,
) -> Result<bool, StorageError>where
S: AnyBlockStorage,
pub fn stream<S>(
&self,
storage: &S,
) -> impl Stream<Item = Result<K, StorageError>> + '_where
S: AnyBlockStorage,
pub fn into_stream<S>(
self,
storage: S,
) -> impl Stream<Item = Result<K, StorageError>> + 'staticwhere
S: AnyBlockStorage,
pub async fn insert<S>(
&mut self,
storage: &S,
key: K,
) -> Result<(), StorageError>where
S: AnyBlockStorage,
Sourcepub async fn remove<S>(
&mut self,
storage: &S,
key: K,
) -> Result<bool, StorageError>where
S: AnyBlockStorage,
pub async fn remove<S>(
&mut self,
storage: &S,
key: K,
) -> Result<bool, StorageError>where
S: AnyBlockStorage,
Remove key from set and return true if it was present.
pub async fn open<S>(
&self,
storage: &S,
) -> Result<CoSetTransaction<S, K>, StorageError>where
S: AnyBlockStorage,
pub async fn open_lazy<S>(
&self,
storage: &S,
) -> Result<LazyTransaction<S, Self>, StorageError>where
S: AnyBlockStorage,
Sourcepub async fn commit<S>(
&mut self,
transaction: CoSetTransaction<S, K>,
) -> Result<(), StorageError>where
S: AnyBlockStorage,
pub async fn commit<S>(
&mut self,
transaction: CoSetTransaction<S, K>,
) -> Result<(), StorageError>where
S: AnyBlockStorage,
Commit transaction to this map.
Sourcepub async fn with_transaction<S, F, Fut>(
&mut self,
storage: &S,
update: F,
) -> Result<(), StorageError>where
S: AnyBlockStorage,
F: FnOnce(CoSetTransaction<S, K>) -> Fut + Send,
Fut: Future<Output = Result<CoSetTransaction<S, K>, StorageError>> + Send,
pub async fn with_transaction<S, F, Fut>(
&mut self,
storage: &S,
update: F,
) -> Result<(), StorageError>where
S: AnyBlockStorage,
F: FnOnce(CoSetTransaction<S, K>) -> Fut + Send,
Fut: Future<Output = Result<CoSetTransaction<S, K>, StorageError>> + Send,
Open transaction, apply update and store it.
Trait Implementations§
Source§impl<'de, K> Deserialize<'de> for CoSet<K>
impl<'de, K> Deserialize<'de> for CoSet<K>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K> Ord for CoSet<K>
impl<K> Ord for CoSet<K>
Source§impl<K> PartialOrd for CoSet<K>
impl<K> PartialOrd for CoSet<K>
Source§impl<S, K> Streamable<S> for CoSet<K>where
S: AnyBlockStorage,
K: Hash + Ord + Clone + Serialize + DeserializeOwned + Send + Sync + 'static,
impl<S, K> Streamable<S> for CoSet<K>where
S: AnyBlockStorage,
K: Hash + Ord + Clone + Serialize + DeserializeOwned + Send + Sync + 'static,
Source§impl<S, K> Transactionable<S> for CoSet<K>where
S: AnyBlockStorage,
K: Hash + Ord + Clone + Serialize + DeserializeOwned + Send + Sync + 'static,
impl<S, K> Transactionable<S> for CoSet<K>where
S: AnyBlockStorage,
K: Hash + Ord + Clone + Serialize + DeserializeOwned + Send + Sync + 'static,
type Transaction = CoSetTransaction<S, K>
fn open<'life0, 'life1, 'async_trait>(
&'life0 self,
storage: &'life1 S,
) -> Pin<Box<dyn Future<Output = Result<Self::Transaction, StorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
impl<K> Eq for CoSet<K>
impl<K> StructuralPartialEq for CoSet<K>
Auto Trait Implementations§
impl<K> Freeze for CoSet<K>
impl<K> RefUnwindSafe for CoSet<K>where
K: RefUnwindSafe,
impl<K> Send for CoSet<K>
impl<K> Sync for CoSet<K>
impl<K> Unpin for CoSet<K>where
K: Unpin,
impl<K> UnsafeUnpin for CoSet<K>
impl<K> UnwindSafe for CoSet<K>where
K: UnwindSafe + 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> 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