Struct bonsaidb::core::connection::Collection
source · [−]pub struct Collection<'a, Cn, Cl> { /* private fields */ }
Expand description
Interacts with a collection over a Connection
.
Implementations
Creates a new instance using connection
.
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>(&'_ self, contents: B) -> Result<Header, Error> where
B: Into<Bytes> + Send,
Cl: SerializedCollection,
pub async fn push_bytes<B>(&'_ self, contents: B) -> Result<Header, Error> where
B: Into<Bytes> + Send,
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>(
&'_ self,
id: u64,
contents: B
) -> Result<Header, Error> where
B: Into<Bytes> + Send,
Cl: SerializedCollection,
pub async fn insert_bytes<B>(
&'_ self,
id: u64,
contents: B
) -> Result<Header, Error> where
B: Into<Bytes> + Send,
Cl: SerializedCollection,
Adds a new Document<Cl>
with the the given id
and contents
.
Retrieves a Document<Cl>
with id
from the connection.
pub async fn get_multiple(
&'_ self,
ids: &'_ [u64]
) -> Result<Vec<OwnedDocument, Global>, Error>
pub async fn get_multiple(
&'_ self,
ids: &'_ [u64]
) -> Result<Vec<OwnedDocument, Global>, Error>
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
pub fn vzip(self) -> V
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