Struct couchdb::path::DocumentId
[−]
[src]
pub struct DocumentId(_);
DocumentId
comprises one or more URL path segments that, together,
identify a document.
For example, given the document path /db/_design/doc
, the document id is
_design/doc
.
For more information about path-related types, see the module-level documentation.
Methods
impl DocumentId
[src]
fn new<T: Into<String>>(s: T) -> Self
Constructs a new document id.
fn into_string(self) -> String
Converts the document id into a string.
fn is_normal(&self) -> bool
Returns whether the document id specifies a normal document—i.e., neither a design document nor a local document.
fn into_normal_document_name(self) -> Result<NormalDocumentName, DocumentId>
Tries to convert the document id into a normal document name.
The conversion fails if and only if the document id does not specify a
normal document. In other words, the conversion succeeds if and only if
the document id begins with neither the _design/
prefix nor the
_local
prefix.
fn is_design(&self) -> bool
Returns whether the document id specifies a design document—i.e., the
document begins with the _design/
prefix.
fn into_design_document_name(self) -> Result<DesignDocumentName, DocumentId>
Tries to convert the document id into a design document name.
fn into_design_document_id(self) -> Result<DesignDocumentId, DocumentId>
Tries to converts the document id into a design document id.
The conversion fails if and only if the document id does not specify a
design document. In other words, the conversion succeeds if and only if
the document id begins with the _design/
prefix.
fn is_local(&self) -> bool
Returns whether the document id specifies a local document—i.e., the
document begins with the _local/
prefix.
fn into_local_document_name(self) -> Result<LocalDocumentName, DocumentId>
Tries to convert the document id into a local document name.
The conversion fails if and only if the document id does not specify a
local document. In other words, the conversion succeeds if and only if
the document id begins with the _local/
prefix.
Trait Implementations
impl Clone for DocumentId
[src]
fn clone(&self) -> DocumentId
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for DocumentId
[src]
impl Default for DocumentId
[src]
fn default() -> DocumentId
Returns the "default value" for a type. Read more
impl Eq for DocumentId
[src]
impl Hash for DocumentId
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Ord for DocumentId
[src]
fn cmp(&self, __arg_0: &DocumentId) -> Ordering
This method returns an Ordering
between self
and other
. Read more
impl PartialEq for DocumentId
[src]
fn eq(&self, __arg_0: &DocumentId) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &DocumentId) -> bool
This method tests for !=
.
impl PartialOrd for DocumentId
[src]
fn partial_cmp(&self, __arg_0: &DocumentId) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &DocumentId) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &DocumentId) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &DocumentId) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &DocumentId) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl AsRef<str> for DocumentId
[src]
impl Display for DocumentId
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl<'a> From<&'a str> for DocumentId
[src]
impl From<String> for DocumentId
[src]
impl From<DesignDocumentId> for DocumentId
[src]
fn from(ddoc_id: DesignDocumentId) -> Self
Performs the conversion.
impl From<NormalDocumentName> for DocumentId
[src]
fn from(doc_name: NormalDocumentName) -> Self
Performs the conversion.
impl From<DesignDocumentName> for DocumentId
[src]
fn from(ddoc_name: DesignDocumentName) -> Self
Performs the conversion.
impl From<LocalDocumentName> for DocumentId
[src]
fn from(ldoc_name: LocalDocumentName) -> Self
Performs the conversion.