Struct couchdb::ViewResult [] [src]

pub struct ViewResult<K, V> where K: Deserialize, V: Deserialize {
    pub total_rows: Option<u64>,
    pub offset: Option<u64>,
    pub rows: Vec<ViewRow<K, V>>,
    // some fields omitted
}

Response resulting from executing a view.

A ViewResult contains all content in the response from the CouchDB server as a result of executing a view.

A ViewResult takes one of two forms. The first form is that the view has been reduced, in which case the total_rows and offset fields are None and the rows field contains a single row containing the reduced result. The second form is that the view has not been reduced, in which case the total_rows and offset fields are Some and the rows field contains zero or more rows containing the unreduced result.

Although the ViewResult 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 ViewResult 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

total_rows

Number of rows in an unreduced view, including rows excluded in the rows field.

offset

Number of rows in an unreduced view excluded before the first row in the rows field.

rows

All rows included in the response content for an unreduced view, or, for a reduced view, the one row containing the reduced result.

Methods

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

fn new() -> Self

Constructs an empty view result.

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

Constructs a view result containing only the given value.

Trait Implementations

impl<K, V> Deserialize for ViewResult<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 ViewResult<K, V> where K: Deserialize, V: Deserialize

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

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

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

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

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

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

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

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

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

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

impl<K: Hash, V: Hash> Hash for ViewResult<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 ViewResult<K, V> where K: Deserialize, V: Deserialize

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

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

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

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

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