pub struct Collection<Record> { /* private fields */ }Expand description
A handle to one strongly typed collection.
Implementations§
Source§impl<Record: IrohRecord> Collection<Record>
impl<Record: IrohRecord> Collection<Record>
Sourcepub async fn put(&self, record: Record) -> Result<ChangeBatch, DbError>
pub async fn put(&self, record: Record) -> Result<ChangeBatch, DbError>
Atomically creates or replaces one materialized CRDT record.
Sourcepub async fn get(&self, id: &Record::Id) -> Result<Option<Record>, DbError>
pub async fn get(&self, id: &Record::Id) -> Result<Option<Record>, DbError>
Reads one record entirely from local materialized state.
Sourcepub async fn delete(&self, id: &Record::Id) -> Result<ChangeBatch, DbError>
pub async fn delete(&self, id: &Record::Id) -> Result<ChangeBatch, DbError>
Atomically deletes one record if present.
Sourcepub fn subscribe(&self) -> Result<Subscription<Record>, DbError>
pub fn subscribe(&self) -> Result<Subscription<Record>, DbError>
Subscribes to future atomic changes for this collection.
Auto Trait Implementations§
impl<Record> Freeze for Collection<Record>
impl<Record> !RefUnwindSafe for Collection<Record>
impl<Record> Send for Collection<Record>
impl<Record> Sync for Collection<Record>
impl<Record> Unpin for Collection<Record>
impl<Record> !UnwindSafe for Collection<Record>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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