Enum couchdb::DocumentId [] [src]

pub enum DocumentId {
    Normal(DocumentName),
    Design(DesignDocumentName),
    Local(DocumentName),
}

Document identifier.

A document id specifies a document's type and name. For example, given the HTTP request to GET http://example.com:5984/db/_design/design-doc, the document id comprises _design/design-doc and specifies a design document with the name design-doc.

There are three types of documents: normal, design (i.e., _design), and local (i.e., _local). Each type is expressed as an enum variant that owns the underlying document name.

Although the DocumentId 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 DocumentId 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.

Variants

Normal

Normal document—i.e., neither a design document nor a local document.

Design

Design document (i.e., _design).

Local

Local document (i.e., _local).

Trait Implementations

impl Display for DocumentId

fn fmt(&self, f: &mut Formatter) -> Result<(), Error>

impl<'a> From<&'a str> for DocumentId

fn from(name: &str) -> Self

impl From<String> for DocumentId

fn from(name: String) -> Self

impl Serialize for DocumentId

fn serialize<S>(&self, serializer: &mut S) -> Result<(), S::Error> where S: Serializer

impl Deserialize for DocumentId

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

Derived Implementations

impl PartialOrd for DocumentId

fn partial_cmp(&self, __arg_0: &DocumentId) -> Option<Ordering>

fn lt(&self, __arg_0: &DocumentId) -> bool

fn le(&self, __arg_0: &DocumentId) -> bool

fn gt(&self, __arg_0: &DocumentId) -> bool

fn ge(&self, __arg_0: &DocumentId) -> bool

impl PartialEq for DocumentId

fn eq(&self, __arg_0: &DocumentId) -> bool

fn ne(&self, __arg_0: &DocumentId) -> bool

impl Ord for DocumentId

fn cmp(&self, __arg_0: &DocumentId) -> Ordering

impl Hash for DocumentId

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

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

impl Eq for DocumentId

impl Debug for DocumentId

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

impl Clone for DocumentId

fn clone(&self) -> DocumentId

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