[−][src]Struct couch_rs::document::Document
Document abstracts the handling of JSON values and provides direct access
and casting to the fields of your documents You can get access to the
fields via the implementation of the Index
and IndexMut
traits
Fields
_id: DocumentId
Document ID, provided by CouchDB
_rev: String
Document Revision, provided by CouchDB, helps negotiating conflicts
Implementations
impl Document
[src]
pub fn new(doc: Value) -> Document
[src]
pub fn get_keys(&self) -> Vec<String>
[src]
Returns all document's keys
pub fn get_data(&self) -> Value
[src]
Returns raw JSON data from document
pub fn merge(&mut self, doc: Value) -> &Self
[src]
Merges this document with a raw JSON value, useful to update data with a payload
pub async fn populate<'_, '_, '_>(
&'_ mut self,
field: &'_ str,
db: Database
) -> &'_ Self
[src]
&'_ mut self,
field: &'_ str,
db: Database
) -> &'_ Self
Recursively populates field (must be an array of IDs from another database) with provided database documents
Trait Implementations
impl Clone for Document
[src]
impl Debug for Document
[src]
impl<'de> Deserialize<'de> for Document
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl<I> Index<I> for Document where
I: Index,
[src]
I: Index,
impl<I> IndexMut<I> for Document where
I: Index,
[src]
I: Index,
impl PartialEq<Document> for Document
[src]
impl Serialize for Document
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralPartialEq for Document
[src]
Auto Trait Implementations
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Sealed<T> for T where
T: ?Sized,
T: ?Sized,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,