Struct couchdb::Client [] [src]

pub struct Client {
    // some fields omitted
}

Entry point for communicating with a CouchDB server.

The Client is the principal type for communicating with a CouchDB server. All CouchDB actions (e.g., PUT database, GET document, etc.) go through a Client.

A Client communicates with exactly one CouchDB server, as specified by the URI set when the Client is constructed.

Methods

impl<'a> Client

fn new<U: IntoUrl>(uri: U) -> Result<Self, Error>

Constructs a CouchDB client.

fn uri(&self) -> &Url

Gets the server URI the client connects to.

fn get_root(&'a self) -> GetRoot<'a>

Builds an action to GET the server's root resource (i.e., /).

fn get_all_databases(&'a self) -> GetAllDatabases<'a>

Builds an action to GET all database names.

fn head_database<P: IntoDatabasePath>(&'a self, path: P) -> HeadDatabase<'a, P>

Builds an action to HEAD a database.

fn get_database<P: IntoDatabasePath>(&'a self, path: P) -> GetDatabase<'a, P>

Builds an action to GET a database.

fn put_database<P: IntoDatabasePath>(&'a self, path: P) -> PutDatabase<'a, P>

Builds an action to PUT a database.

fn delete_database<P: IntoDatabasePath>(&'a self, path: P) -> DeleteDatabase<'a, P>

Builds an action to DELETE a database.

fn post_database<P: IntoDatabasePath, T: Serialize>(&'a self, path: P, doc_content: &'a T) -> PostDatabase<'a, P, T>

Builds an action to POST to a database.

fn get_changes<P>(&'a self, path: P) -> GetChanges<'a, P> where P: IntoDatabasePath

Builds an action to GET changes made to a database.

fn head_document<P: IntoDocumentPath>(&'a self, path: P) -> HeadDocument<'a, P>

Builds an action to HEAD a document.

fn get_document<P: IntoDocumentPath>(&'a self, path: P) -> GetDocument<'a, P>

Builds an action to GET a document.

fn put_document<P: IntoDocumentPath, T: Serialize>(&'a self, path: P, doc_content: &'a T) -> PutDocument<'a, P, T>

Builds an action to PUT a document.

fn delete_document<P: IntoDocumentPath>(&'a self, path: P, rev: &'a Revision) -> DeleteDocument<'a, P>

Builds an action to DELETE a document.

fn get_view<P: IntoViewPath, K: Deserialize + Serialize, V: Deserialize>(&'a self, path: P) -> GetView<'a, P, K, V>

Builds an action to GET a view.