Struct bonsaidb_core::transaction::Operation
source · [−]pub struct Operation {
pub collection: CollectionName,
pub command: Command,
}Expand description
A single operation performed on a Collection.
Fields
collection: CollectionNameThe id of the Collection.
command: CommandThe command being performed.
Implementations
Inserts a new document with contents into collection. If id is
None a unique id will be generated. If an id is provided and a
document already exists with that id, a conflict error will be returned.
pub fn insert_serialized<C: SerializedCollection>(
id: Option<u64>,
contents: &C::Contents
) -> Result<Self, Error>
pub fn insert_serialized<C: SerializedCollection>(
id: Option<u64>,
contents: &C::Contents
) -> Result<Self, Error>
Inserts a new document with the serialized representation of contents
into collection. If id is None a unique id will be generated. If
an id is provided and a document already exists with that id, a conflict
error will be returned.
Updates a document in collection.
pub fn update_serialized<C: SerializedCollection>(
header: Header,
contents: &C::Contents
) -> Result<Self, Error>
pub fn update_serialized<C: SerializedCollection>(
header: Header,
contents: &C::Contents
) -> Result<Self, Error>
Updates a document with the serialized representation of contents in
collection.
Deletes a document from a collection.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
impl RefUnwindSafe for Operation
impl UnwindSafe for Operation
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