pub struct Get<'a> {
pub request_builder: Result<Builder, Error>,
pub client: &'a HttperClient,
pub headers: Headers,
}
Fields§
§request_builder: Result<Builder, Error>
§client: &'a HttperClient
§headers: Headers
Implementations§
Source§impl<'a> Get<'a>
impl<'a> Get<'a>
Sourcepub fn new(
request_builder: Result<Builder, Error>,
client: &'a HttperClient,
) -> Self
pub fn new( request_builder: Result<Builder, Error>, client: &'a HttperClient, ) -> Self
Creates a new Get
.
Sourcepub fn headers(self, headers: Headers) -> Self
pub fn headers(self, headers: Headers) -> Self
Attach headers to the request
§Examples
use httper::client::HttperClient;
use std::collections::HashMap;
let httper_client = HttperClient::new();
let mut headers = HashMap::new();
headers.insert("Content-Type".to_string(), "application/json".to_string());
httper_client.get("http://localhost:9090").headers(headers).send();
Sourcepub fn send(self) -> ResponseFuture
pub fn send(self) -> ResponseFuture
Sends the request and returns a ResponseFuture
.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Get<'a>
impl<'a> !RefUnwindSafe for Get<'a>
impl<'a> Send for Get<'a>
impl<'a> Sync for Get<'a>
impl<'a> Unpin for Get<'a>
impl<'a> !UnwindSafe for Get<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more