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.