Struct couchdb::DatabasePath [] [src]

pub struct DatabasePath {
    // some fields omitted
}

Path part of a URI specifying a database.

A database path comprises a single URI path component specifying a database name—the /db part of the HTTP request to GET http://example.com:5984/db.

Database paths are percent-encoded. For example, /foo%2Fbar identifies the database named foo/bar. When a DatabasePath is constructed from a DatabaseName, the percent-encoding is done automatically. When constructing a DatabasePath from a string, the string must be percent-encoded.

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

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

Constructs a DatabasePath from a given string.

The path string must begin with a leading slash and be percent-encoded—e.g., /foo%2Fbar for the database named foo/bar. For valid CouchDB database names, this matters only if the name contains a slash character.

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

Converts self into a URI.

Trait Implementations

impl Display for DatabasePath

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

impl FromStr for DatabasePath

type Err = Error

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

impl From<DatabaseName> for DatabasePath

fn from(db_name: DatabaseName) -> Self

Derived Implementations

impl PartialOrd for DatabasePath

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

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

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

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

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

impl PartialEq for DatabasePath

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

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

impl Ord for DatabasePath

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

impl Hash for DatabasePath

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

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

impl Eq for DatabasePath

impl Debug for DatabasePath

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

impl Clone for DatabasePath

fn clone(&self) -> DatabasePath

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