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.