Struct couchdb::ViewRow [] [src]

pub struct ViewRow<K, V> where K: Deserialize, V: Deserialize {
    pub id: Option<DocumentId>,
    pub key: Option<K>,
    pub value: V,
    // some fields omitted
}

Single row contained in the response resulting from executing a view.

A ViewRow takes one of two forms. The first form is that the view has been reduced, in which case the id and key fields are None and the value field contains the reduced result. The second form is that the view has not been reduced, in which case the id and key fields are Some and the value field contains one of the rows of the view result.

Although the ViewRow type implements the Ord and PartialOrd traits, it provides no guarantees how that ordering is defined and may change the definition between any two releases of the couchdb crate. That is, for two ViewRow values a and b, the expression a < b may hold true now but not in a subsequent release. Consequently, applications must not rely upon any particular ordering definition.

Fields

id

Id of the document, if and only if the view has not been reduced.

key

Emitted key, if and only if the view has not been reduced.

value

Emitted value, either reduced or not.

Methods

impl<K, V> ViewRow<K, V> where K: Deserialize, V: Deserialize

fn new<T: Into<V>>(value: T) -> Self

Constructs a minimum view row containing only a value.

The newly constructed view row has no id and no key.

Trait Implementations

impl<K, V> Deserialize for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn deserialize<D>(d: &mut D) -> Result<Self, D::Error> where D: Deserializer

Derived Implementations

impl<K: PartialOrd, V: PartialOrd> PartialOrd for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn partial_cmp(&self, __arg_0: &ViewRow<K, V>) -> Option<Ordering>

fn lt(&self, __arg_0: &ViewRow<K, V>) -> bool

fn le(&self, __arg_0: &ViewRow<K, V>) -> bool

fn gt(&self, __arg_0: &ViewRow<K, V>) -> bool

fn ge(&self, __arg_0: &ViewRow<K, V>) -> bool

impl<K: PartialEq, V: PartialEq> PartialEq for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn eq(&self, __arg_0: &ViewRow<K, V>) -> bool

fn ne(&self, __arg_0: &ViewRow<K, V>) -> bool

impl<K: Ord, V: Ord> Ord for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn cmp(&self, __arg_0: &ViewRow<K, V>) -> Ordering

impl<K: Hash, V: Hash> Hash for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn hash<__H: Hasher>(&self, __arg_0: &mut __H)

fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher

impl<K: Eq, V: Eq> Eq for ViewRow<K, V> where K: Deserialize, V: Deserialize

impl<K: Debug, V: Debug> Debug for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn fmt(&self, __arg_0: &mut Formatter) -> Result

impl<K: Clone, V: Clone> Clone for ViewRow<K, V> where K: Deserialize, V: Deserialize

fn clone(&self) -> ViewRow<K, V>

fn clone_from(&mut self, source: &Self)