Struct bonsaidb_core::document::OwnedDocument
source · [−]Expand description
Contains a serialized document in the database.
Fields
header: HeaderThe header of the document, which contains the id and Revision.
contents: BytesThe serialized bytes of the stored item.
Methods from Deref<Target = Header>
Creates a Map result with a key and an empty value.
Creates a Map result with value and an empty key.
pub fn emit_key_and_value<K: for<'a> Key<'a>, Value>(
&self,
key: K,
value: Value
) -> Mappings<K, Value>
pub fn emit_key_and_value<K: for<'a> Key<'a>, Value>(
&self,
key: K,
value: Value
) -> Mappings<K, Value>
Creates a Map result with a key and value.
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
Creates a new document with contents.
fn with_contents<S: SerializedCollection<Contents = S>>(
id: u64,
contents: &S
) -> Result<Self, Error>
fn with_contents<S: SerializedCollection<Contents = S>>(
id: u64,
contents: &S
) -> Result<Self, Error>
Creates a new document with serialized bytes from contents.
Retrieves contents through deserialization into the type D.
fn set_contents<S: SerializedCollection<Contents = S>>(
&mut self,
contents: &S
) -> Result<(), Error>
fn set_contents<S: SerializedCollection<Contents = S>>(
&mut self,
contents: &S
) -> Result<(), Error>
Serializes and stores contents into this document.
impl<'a, C> TryFrom<&'a OwnedDocument> for CollectionDocument<C> where
C: SerializedCollection,
impl<'a, C> TryFrom<&'a OwnedDocument> for CollectionDocument<C> where
C: SerializedCollection,
Auto Trait Implementations
impl RefUnwindSafe for OwnedDocument
impl Send for OwnedDocument
impl Sync for OwnedDocument
impl Unpin for OwnedDocument
impl UnwindSafe for OwnedDocument
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