Struct pliantdb_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 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: Key, Value: Serialize>(
&self,
key: K,
value: Value
) -> Map<K, Value>
pub fn emit_key_and_value<K: Key, Value: Serialize>(
&self,
key: K,
value: Value
) -> Map<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
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