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.