Expand description
Contains a serialized document in the database.
Fields
header: Header
The 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, Value>(
&self,
key: K,
value: Value
) -> Mappings<K, Value> where
K: for<'a> Key<'a>,
pub fn emit_key_and_value<K, Value>(
&self,
key: K,
value: Value
) -> Mappings<K, Value> where
K: for<'a> Key<'a>,
Creates a Map
result with a key
and value
.
Trait Implementations
Mutably dereferences the value.
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<BorrowedDocument<'a>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<BorrowedDocument<'a>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Creates a new document with contents
.
pub fn with_contents<S>(
id: u64,
contents: &S
) -> Result<BorrowedDocument<'a>, Error> where
S: SerializedCollection<Contents = S>,
pub fn with_contents<S>(
id: u64,
contents: &S
) -> Result<BorrowedDocument<'a>, Error> where
S: SerializedCollection<Contents = S>,
Creates a new document with serialized bytes from contents
.
pub fn contents<D>(
&self
) -> Result<<D as SerializedCollection>::Contents, Error> where
D: SerializedCollection<Contents = D>,
pub fn contents<D>(
&self
) -> Result<<D as SerializedCollection>::Contents, Error> where
D: SerializedCollection<Contents = D>,
Retrieves contents
through deserialization into the type D
.
pub fn set_contents<S>(&mut self, contents: &S) -> Result<(), Error> where
S: SerializedCollection<Contents = S>,
pub fn set_contents<S>(&mut self, contents: &S) -> Result<(), Error> where
S: SerializedCollection<Contents = S>,
Serializes and stores contents
into this document.
pub fn create_new_revision(
&self,
contents: impl Into<<BorrowedDocument<'a> as Document<'a>>::Bytes>
) -> Option<BorrowedDocument<'a>>
pub fn create_new_revision(
&self,
contents: impl Into<<BorrowedDocument<'a> as Document<'a>>::Bytes>
) -> Option<BorrowedDocument<'a>>
Creates a new revision. Read more
Performs the conversion.
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
pub fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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,
pub fn try_from(
value: &'a BorrowedDocument<'a>
) -> Result<CollectionDocument<C>, <CollectionDocument<C> as TryFrom<&'a BorrowedDocument<'a>>>::Error>
pub fn try_from(
value: &'a BorrowedDocument<'a>
) -> Result<CollectionDocument<C>, <CollectionDocument<C> as TryFrom<&'a BorrowedDocument<'a>>>::Error>
Performs the conversion.
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,
pub fn try_from(
value: &'b CollectionDocument<C>
) -> Result<BorrowedDocument<'a>, <BorrowedDocument<'a> as TryFrom<&'b CollectionDocument<C>>>::Error>
pub fn try_from(
value: &'b CollectionDocument<C>
) -> Result<BorrowedDocument<'a>, <BorrowedDocument<'a> as TryFrom<&'b CollectionDocument<C>>>::Error>
Performs the conversion.
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
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