Struct couchdb::action::GetDocument
[−]
[src]
pub struct GetDocument<'a, P> where P: IntoDocumentPath {
// some fields omitted
}
Action to get document meta-information and application-defined content.
Return
This action returns an Option
type. The return value is None
if the
action specifies a revision and the document hasn't been modified since
that revision. Otherwise, the return value is Some
and contains the
document meta-information and application-defined content.
Errors
The following are some of the errors that may occur as a result of executing this action:
Error::NotFound
: The document does not exist.Error::Unauthorized
: The client is unauthorized.
Methods
impl<'a, P: IntoDocumentPath> GetDocument<'a, P>
fn attachments(self, value: bool) -> Self
The attachments
method sets the action's attachments
query parameter
to the given value.
If the attachments
query value is true
then the action's result will
include the bodies of all attachments to the document. The default value
is false
.
fn if_none_match(self, rev: &'a Revision) -> Self
Sets the If-None-Match header.
fn rev(self, rev: &'a Revision) -> Self
Sets the rev
query parameter to get the document at the given
revision.
fn run(self) -> Result<Option<Document>, Error>
Sends the action request and waits for the response.