Struct couchdb::DesignDocumentPath [] [src]

pub struct DesignDocumentPath {
    // some fields omitted
}

Path part of a URI specifying a design document.

A design document path comprises three URI path components specifying a database name and design document name—the /db/_design/design-doc part of http://example.com:5984/db/_design/design-doc. The DesignDocumentPath type is a specialization of the DocumentPath type. All design document paths are document paths, but not all document paths are design document paths.

Design document paths are percent-encoded. For example, /foo/_design/bar%2Fqux identifies the database named foo and the design document named bar%2Fqux. When a DesignDocumentPath is constructed from name and path types, the percent-encoding is done automatically. When constructing a DesignDocumentPath from a string, the string must be percent-encoded.

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

Methods

impl DesignDocumentPath

fn parse<T: AsRef<str>>(path: T) -> Result<Self, Error>

Constructs a DesignDocumentPath from a given string.

The path string must begin with a leading slash and be percent-encoded—e.g., /foo/_design/bar%2Fqux for the database named foo and the design document named bar/qux.

fn into_uri(self, base_uri: Url) -> Url

Converts self into a URI.

Trait Implementations

impl IntoDesignDocumentPath for DesignDocumentPath

fn into_design_document_path(self) -> Result<DesignDocumentPath, Error>

impl Display for DesignDocumentPath

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

impl FromStr for DesignDocumentPath

type Err = Error

fn from_str(path: &str) -> Result<Self, Self::Err>

impl<T: Into<DatabasePath>> From<(T, DesignDocumentName)> for DesignDocumentPath

fn from(parts: (T, DesignDocumentName)) -> Self

impl IntoDocumentPath for DesignDocumentPath

fn into_document_path(self) -> Result<DocumentPath, Error>

Derived Implementations

impl PartialOrd for DesignDocumentPath

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

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

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

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

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

impl PartialEq for DesignDocumentPath

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

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

impl Ord for DesignDocumentPath

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

impl Hash for DesignDocumentPath

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

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

impl Eq for DesignDocumentPath

impl Debug for DesignDocumentPath

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

impl Clone for DesignDocumentPath

fn clone(&self) -> DesignDocumentPath

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