Enum bonsaidb_core::transaction::Command
source · [−]pub enum Command {
Insert {
id: Option<u64>,
contents: Bytes,
},
Update {
header: Header,
contents: Bytes,
},
Delete {
header: Header,
},
}Expand description
A command to execute within a Collection.
Variants
Insert
Fields
id: Option<u64>An optional id for the document. If this is None, a unique id will
be generated. If this is Some() and a document already exists with
that id, a conflict error will be returned.
contents: BytesThe initial contents of the document.
Inserts a new document containing contents.
Update
Fields
header: HeaderThe header of the Document. The revision must match the current
document.
contents: BytesThe new contents to store within the Document.
Update an existing Document identified by id. revision must match
the currently stored revision on the Document. If it does not, the
command fill fail with a DocumentConflict error.
Delete
Fields
header: HeaderThe current header of the Document.
Delete an existing Document identified by id. revision must match
the currently stored revision on the Document. If it does not, the
command fill fail with a DocumentConflict error.
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 Command
impl UnwindSafe for Command
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