pub struct Collection<T> { /* private fields */ }Expand description
Typed handle for records in a collection.
Implementations§
Source§impl<T> Collection<T>
impl<T> Collection<T>
Sourcepub fn new(store: Store, name: CollectionName) -> Self
pub fn new(store: Store, name: CollectionName) -> Self
Creates a collection handle.
Sourcepub fn name(&self) -> &CollectionName
pub fn name(&self) -> &CollectionName
Returns the collection name.
Sourcepub async fn scan_prefix(
&self,
prefix: impl Into<String>,
) -> Result<Vec<(Key, T)>>where
T: DeserializeOwned,
pub async fn scan_prefix(
&self,
prefix: impl Into<String>,
) -> Result<Vec<(Key, T)>>where
T: DeserializeOwned,
Scans typed values by key prefix.
Trait Implementations§
Source§impl<T: Clone> Clone for Collection<T>
impl<T: Clone> Clone for Collection<T>
Source§fn clone(&self) -> Collection<T>
fn clone(&self) -> Collection<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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<T> !RefUnwindSafe for Collection<T>
impl<T> !UnwindSafe for Collection<T>
impl<T> Freeze for Collection<T>
impl<T> Send for Collection<T>where
T: Send,
impl<T> Sync for Collection<T>where
T: Sync,
impl<T> Unpin for Collection<T>where
T: Unpin,
impl<T> UnsafeUnpin for Collection<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