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.