Struct couchdb::ViewPath [] [src]

pub struct ViewPath {
    // some fields omitted
}

Path part of a URI specifying a view.

A view path comprises five URI path components specifying a database name, design document name, and view name—the /db/_design/design-doc/_view/view-name part of http://example.com:5984/db/_design/design-doc/_view/view-name.

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

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

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

Constructs a ViewPath from a given string.

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

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

Converts self into a URI.

Trait Implementations

impl IntoViewPath for ViewPath

fn into_view_path(self) -> Result<ViewPath, Error>

impl Display for ViewPath

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

impl FromStr for ViewPath

type Err = Error

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

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

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

Derived Implementations

impl PartialOrd for ViewPath

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

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

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

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

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

impl PartialEq for ViewPath

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

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

impl Ord for ViewPath

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

impl Hash for ViewPath

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

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

impl Eq for ViewPath

impl Debug for ViewPath

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

impl Clone for ViewPath

fn clone(&self) -> ViewPath

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