pub struct AsyncCollection<T> { /* private fields */ }Available on crate feature
async only.Expand description
Async-facing wrapper over a runtime-named read-only collection handle.
Cheap to clone — holds one Arc<Db> + the collection name.
Implementations§
Source§impl<T> AsyncCollection<T>
impl<T> AsyncCollection<T>
Sourcepub async fn get(&self, id: Id) -> Result<Option<T>>
pub async fn get(&self, id: Id) -> Result<Option<T>>
Async sibling of crate::Collection::get. Opens a private
read transaction inside the blocking task.
§Errors
Sourcepub async fn find_unique<K>(
&self,
index_name: &str,
key: K,
) -> Result<Option<T>>
pub async fn find_unique<K>( &self, index_name: &str, key: K, ) -> Result<Option<T>>
Trait Implementations§
Source§impl<T> Clone for AsyncCollection<T>
impl<T> Clone for AsyncCollection<T>
Auto Trait Implementations§
impl<T> Freeze for AsyncCollection<T>
impl<T> RefUnwindSafe for AsyncCollection<T>
impl<T> Send for AsyncCollection<T>
impl<T> Sync for AsyncCollection<T>
impl<T> Unpin for AsyncCollection<T>
impl<T> UnsafeUnpin for AsyncCollection<T>
impl<T> UnwindSafe for AsyncCollection<T>
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