Struct bonsaidb_core::document::BorrowedDocument
source · [−]Expand description
Contains a serialized document in the database.
Fields
header: HeaderThe header of the document, which contains the id and Revision.
contents: CowBytes<'a>The serialized bytes of the stored item.
Implementations
Converts this document to an owned document.
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.
Performs the conversion.
impl<'a, C> TryFrom<&'a BorrowedDocument<'a>> for CollectionDocument<C> where
C: SerializedCollection,
impl<'a, C> TryFrom<&'a BorrowedDocument<'a>> for CollectionDocument<C> where
C: SerializedCollection,
impl<'a, 'b, C> TryFrom<&'b CollectionDocument<C>> for BorrowedDocument<'a> where
C: SerializedCollection,
impl<'a, 'b, C> TryFrom<&'b CollectionDocument<C>> for BorrowedDocument<'a> where
C: SerializedCollection,
Auto Trait Implementations
impl<'a> RefUnwindSafe for BorrowedDocument<'a>
impl<'a> Send for BorrowedDocument<'a>
impl<'a> Sync for BorrowedDocument<'a>
impl<'a> Unpin for BorrowedDocument<'a>
impl<'a> UnwindSafe for BorrowedDocument<'a>
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