Expand description
Contains a serialized document in the database.
Fields
header: Header
The header of the document, which contains the id and Revision
.
contents: Bytes
The 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, 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<OwnedDocument, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<OwnedDocument, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
pub fn new(
id: u64,
contents: impl Into<<OwnedDocument as Document<'static>>::Bytes>
) -> OwnedDocument
pub fn new(
id: u64,
contents: impl Into<<OwnedDocument as Document<'static>>::Bytes>
) -> OwnedDocument
Creates a new document with contents
.
pub fn with_contents<S>(id: u64, contents: &S) -> Result<OwnedDocument, Error> where
S: SerializedCollection<Contents = S>,
pub fn with_contents<S>(id: u64, contents: &S) -> Result<OwnedDocument, 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<<OwnedDocument as Document<'static>>::Bytes>
) -> Option<OwnedDocument>
pub fn create_new_revision(
&self,
contents: impl Into<<OwnedDocument as Document<'static>>::Bytes>
) -> Option<OwnedDocument>
Creates a new revision. Read more
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 OwnedDocument> for CollectionDocument<C> where
C: SerializedCollection,
impl<'a, C> TryFrom<&'a OwnedDocument> for CollectionDocument<C> where
C: SerializedCollection,
pub fn try_from(
value: &'a OwnedDocument
) -> Result<CollectionDocument<C>, <CollectionDocument<C> as TryFrom<&'a OwnedDocument>>::Error>
pub fn try_from(
value: &'a OwnedDocument
) -> Result<CollectionDocument<C>, <CollectionDocument<C> as TryFrom<&'a OwnedDocument>>::Error>
Performs the conversion.
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
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