Struct pliantdb_local::core::document::Document [−][src]
Expand description
Contains a serialized document in the database.
Fields
header: Cow<'a, Header>
The header of the document, which contains the id and Revision
.
contents: Cow<'a, [u8]>
The serialized bytes of the stored item.
Implementations
Creates a new document with contents
.
Creates a new document with serialized bytes from contents
.
Retrieves contents
through deserialization into the type D
.
Serializes and stores contents
into this document.
Creates a new revision.
WARNING: This normally should not be used outside of implementing a
backend for PliantDb
. To update a document, use set_contents()
and
send the document with the existing Revision
information.
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
) -> Map<K, Value> where
Value: Serialize,
K: Key,
pub fn emit_key_and_value<K, Value>(
&self,
key: K,
value: Value
) -> Map<K, Value> where
Value: Serialize,
K: Key,
Creates a Map
result with a key
and value
.
Trait Implementations
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Document<'a>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
pub fn deserialize<__D>(
__deserializer: __D
) -> Result<Document<'a>, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. 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
Auto Trait Implementations
impl<'a> RefUnwindSafe for Document<'a>
impl<'a> UnwindSafe for Document<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more
type Output = T
type Output = T
Should always be Self