pub struct CollectionDocument<C> where
C: SerializedCollection, {
pub header: Header,
pub contents: <C as SerializedCollection>::Contents,
}
Expand description
A document with serializable contents.
Fields
header: Header
The header of the document, which contains the id and Revision
.
contents: <C as SerializedCollection>::Contents
The document’s contents.
Implementations
Stores the new value of contents
in the document.
Modifies self
, automatically retrying the modification if the document
has been updated on the server.
Data loss warning
If you’ve modified self
before calling this function and a conflict
occurs, all changes to self will be lost when the current document is
fetched before retrying the process again. When you use this function,
you should limit the edits to the value to within the modifier
callback.
Removes the document from the collection.
Converts this value to a serialized 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
impl<C> Clone for CollectionDocument<C> where
C: Clone + SerializedCollection,
<C as SerializedCollection>::Contents: Clone,
impl<C> Clone for CollectionDocument<C> where
C: Clone + SerializedCollection,
<C as SerializedCollection>::Contents: Clone,
impl<C> Debug for CollectionDocument<C> where
C: Debug + SerializedCollection,
<C as SerializedCollection>::Contents: Debug,
impl<C> Debug for CollectionDocument<C> where
C: Debug + SerializedCollection,
<C as SerializedCollection>::Contents: Debug,
impl<'a, 'c, C> From<&'c CollectionDocument<C>> for NamedReference<'a> where
C: SerializedCollection,
impl<'a, 'c, C> From<&'c CollectionDocument<C>> for NamedReference<'a> where
C: SerializedCollection,
Performs the conversion.
impl<C> PartialEq<CollectionDocument<C>> for CollectionDocument<C> where
C: PartialEq<C> + SerializedCollection,
<C as SerializedCollection>::Contents: PartialEq<<C as SerializedCollection>::Contents>,
impl<C> PartialEq<CollectionDocument<C>> for CollectionDocument<C> where
C: PartialEq<C> + SerializedCollection,
<C as SerializedCollection>::Contents: PartialEq<<C as SerializedCollection>::Contents>,
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
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, 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.
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.
impl<C> Eq for CollectionDocument<C> where
C: Eq + SerializedCollection,
<C as SerializedCollection>::Contents: Eq,
Auto Trait Implementations
impl<C> RefUnwindSafe for CollectionDocument<C> where
<C as SerializedCollection>::Contents: RefUnwindSafe,
impl<C> Send for CollectionDocument<C>
impl<C> Sync for CollectionDocument<C>
impl<C> Unpin for CollectionDocument<C> where
<C as SerializedCollection>::Contents: Unpin,
impl<C> UnwindSafe for CollectionDocument<C> where
<C as SerializedCollection>::Contents: UnwindSafe,
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
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