[−][src]Struct sapper::Client
reexport hyper's Client to sapper level A Client to use additional features with Requests.
Clients can handle things such as: redirect policy, connection pooling.
Methods
impl Client
[src]
reexport hyper's Client to sapper level
pub fn new() -> Client
[src]
Create a new Client.
pub fn with_pool_config(config: Config) -> Client
[src]
Create a new Client with a configured Pool Config.
pub fn with_http_proxy<H>(host: H, port: u16) -> Client where
H: Into<Cow<'static, str>>,
[src]
H: Into<Cow<'static, str>>,
Create a Client with an HTTP proxy to a (host, port).
pub fn with_proxy_config<C, S>(proxy_config: ProxyConfig<C, S>) -> Client where
C: NetworkConnector + Send + Sync + 'static,
S: SslClient<<C as NetworkConnector>::Stream> + Send + Sync + 'static,
<C as NetworkConnector>::Stream: NetworkStream,
<C as NetworkConnector>::Stream: Send,
<C as NetworkConnector>::Stream: Clone,
[src]
C: NetworkConnector + Send + Sync + 'static,
S: SslClient<<C as NetworkConnector>::Stream> + Send + Sync + 'static,
<C as NetworkConnector>::Stream: NetworkStream,
<C as NetworkConnector>::Stream: Send,
<C as NetworkConnector>::Stream: Clone,
Create a Client using a proxy with a custom connector and SSL client.
pub fn with_connector<C, S>(connector: C) -> Client where
C: NetworkConnector<Stream = S> + Send + Sync + 'static,
S: NetworkStream + Send,
[src]
C: NetworkConnector<Stream = S> + Send + Sync + 'static,
S: NetworkStream + Send,
Create a new client with a specific connector.
pub fn with_protocol<P>(protocol: P) -> Client where
P: 'static + Protocol + Send + Sync,
[src]
P: 'static + Protocol + Send + Sync,
Create a new client with a specific Protocol
.
pub fn set_redirect_policy(&mut self, policy: RedirectPolicy)
[src]
Set the RedirectPolicy.
pub fn set_read_timeout(&mut self, dur: Option<Duration>)
[src]
Set the read timeout value for all requests.
pub fn set_write_timeout(&mut self, dur: Option<Duration>)
[src]
Set the write timeout value for all requests.
pub fn get<U>(&self, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a Get request.
pub fn head<U>(&self, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a Head request.
pub fn patch<U>(&self, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a Patch request.
pub fn post<U>(&self, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a Post request.
pub fn put<U>(&self, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a Put request.
pub fn delete<U>(&self, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a Delete request.
pub fn request<U>(&self, method: Method, url: U) -> RequestBuilder where
U: IntoUrl,
[src]
U: IntoUrl,
Build a new request using this Client.
Trait Implementations
Auto Trait Implementations
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
impl !RefUnwindSafe for Client
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Typeable for T where
T: Any,
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> UnsafeAny for T where
T: Any,
T: Any,