Struct bonsaidb_core::connection::Collection
source · [−]pub struct Collection<'a, Cn, Cl> { /* private fields */ }Expand description
Interacts with a collection over a Connection.
Implementations
pub async fn push(
&self,
item: &<Cl as SerializedCollection>::Contents
) -> Result<Header, Error> where
Cl: SerializedCollection,
pub async fn push(
&self,
item: &<Cl as SerializedCollection>::Contents
) -> Result<Header, Error> where
Cl: SerializedCollection,
Adds a new Document<Cl> with the contents item.
pub async fn push_bytes<B: Into<Bytes> + Send>(
&self,
contents: B
) -> Result<Header, Error> where
Cl: SerializedCollection,
pub async fn push_bytes<B: Into<Bytes> + Send>(
&self,
contents: B
) -> Result<Header, Error> where
Cl: SerializedCollection,
Adds a new Document<Cl> with the contents.
pub async fn insert(
&self,
id: u64,
item: &<Cl as SerializedCollection>::Contents
) -> Result<Header, Error> where
Cl: SerializedCollection,
pub async fn insert(
&self,
id: u64,
item: &<Cl as SerializedCollection>::Contents
) -> Result<Header, Error> where
Cl: SerializedCollection,
Adds a new Document<Cl> with the given id and contents item.
pub async fn insert_bytes<B: Into<Bytes> + Send>(
&self,
id: u64,
contents: B
) -> Result<Header, Error> where
Cl: SerializedCollection,
pub async fn insert_bytes<B: Into<Bytes> + Send>(
&self,
id: u64,
contents: B
) -> Result<Header, Error> where
Cl: SerializedCollection,
Adds a new Document<Cl> with the the given id and contents.
Retrieves a Document<Cl> with id from the connection.
Retrieves all documents matching ids. Documents that are not found
are not returned, but no error will be generated.
Retrieves all documents matching ids. Documents that are not found
are not returned, but no error will be generated.
Trait Implementations
Auto Trait Implementations
impl<'a, Cn, Cl> RefUnwindSafe for Collection<'a, Cn, Cl> where
Cl: RefUnwindSafe,
Cn: RefUnwindSafe,
impl<'a, Cn, Cl> Send for Collection<'a, Cn, Cl> where
Cl: Send,
Cn: Sync,
impl<'a, Cn, Cl> Sync for Collection<'a, Cn, Cl> where
Cl: Sync,
Cn: Sync,
impl<'a, Cn, Cl> Unpin for Collection<'a, Cn, Cl> where
Cl: Unpin,
impl<'a, Cn, Cl> UnwindSafe for Collection<'a, Cn, Cl> where
Cl: UnwindSafe,
Cn: RefUnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more