pub trait ClientLike {
    // Required method
    fn build_conn(&self, method: Method, url: Url) -> Conn;

    // Provided methods
    fn get(&self, url: Url) -> Conn
       where Self: Sized { ... }
    fn post(&self, url: Url) -> Conn
       where Self: Sized { ... }
    fn put(&self, url: Url) -> Conn
       where Self: Sized { ... }
    fn delete(&self, url: Url) -> Conn
       where Self: Sized { ... }
    fn patch(&self, url: Url) -> Conn
       where Self: Sized { ... }
}
Expand description

Trait for things that operate like a client. The only interface that’s required is build_conn.

Required Methods§

source

fn build_conn(&self, method: Method, url: Url) -> Conn

constructs a conn for the specified method and url.

Provided Methods§

source

fn get(&self, url: Url) -> Conn
where Self: Sized,

Builds a new client conn with the get http method and the provided url.

source

fn post(&self, url: Url) -> Conn
where Self: Sized,

Builds a new client conn with the post http method and the provided url.

source

fn put(&self, url: Url) -> Conn
where Self: Sized,

Builds a new client conn with the put http method and the provided url.

source

fn delete(&self, url: Url) -> Conn
where Self: Sized,

Builds a new client conn with the delete http method and the provided url.

source

fn patch(&self, url: Url) -> Conn
where Self: Sized,

Builds a new client conn with the patch http method and the provided url.

Implementors§