Struct sofa::Client [−][src]
Client handles the URI manipulation logic and the HTTP calls to the CouchDB REST API. It is also responsible for the creation/access/destruction of databases.
Fields
uri: String
db_prefix: String
Methods
impl Client
[src]
impl Client
pub fn new(uri: String) -> Result<Client, Error>
[src]
pub fn new(uri: String) -> Result<Client, Error>
pub fn get_self(&mut self) -> &mut Self
[src]
pub fn get_self(&mut self) -> &mut Self
pub fn set_uri(&mut self, uri: String) -> &Self
[src]
pub fn set_uri(&mut self, uri: String) -> &Self
pub fn set_prefix(&mut self, prefix: String) -> &Self
[src]
pub fn set_prefix(&mut self, prefix: String) -> &Self
pub fn gzip(&mut self, enabled: bool) -> Result<&Self, Error>
[src]
pub fn gzip(&mut self, enabled: bool) -> Result<&Self, Error>
pub fn timeout(&mut self, to: u8) -> Result<&Self, Error>
[src]
pub fn timeout(&mut self, to: u8) -> Result<&Self, Error>
pub fn list_dbs(&self) -> Result<Vec<String>, Error>
[src]
pub fn list_dbs(&self) -> Result<Vec<String>, Error>
pub fn db(&self, dbname: &'static str) -> Result<Database, Error>
[src]
pub fn db(&self, dbname: &'static str) -> Result<Database, Error>
pub fn make_db(&self, dbname: &'static str) -> Result<Database, Error>
[src]
pub fn make_db(&self, dbname: &'static str) -> Result<Database, Error>
pub fn destroy_db(&self, dbname: &'static str) -> Result<bool, Error>
[src]
pub fn destroy_db(&self, dbname: &'static str) -> Result<bool, Error>
pub fn check_status(&self) -> Result<CouchStatus, Error>
[src]
pub fn check_status(&self) -> Result<CouchStatus, Error>
pub fn req(
&self,
method: Method,
path: String,
opts: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
[src]
pub fn req(
&self,
method: Method,
path: String,
opts: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
pub fn get(
&self,
path: String,
args: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
[src]
pub fn get(
&self,
path: String,
args: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
pub fn post(&self, path: String, body: String) -> Result<RequestBuilder, Error>
[src]
pub fn post(&self, path: String, body: String) -> Result<RequestBuilder, Error>
pub fn put(&self, path: String, body: String) -> Result<RequestBuilder, Error>
[src]
pub fn put(&self, path: String, body: String) -> Result<RequestBuilder, Error>
pub fn head(
&self,
path: String,
args: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
[src]
pub fn head(
&self,
path: String,
args: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
pub fn delete(
&self,
path: String,
args: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
[src]
pub fn delete(
&self,
path: String,
args: Option<HashMap<String, String>>
) -> Result<RequestBuilder, Error>
Trait Implementations
impl Debug for Client
[src]
impl Debug for Client
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Client
[src]
impl Clone for Client