Struct awc::FrozenClientRequest
source · [−]pub struct FrozenClientRequest { /* private fields */ }
Expand description
FrozenClientRequest
struct represents cloneable client request.
It could be used to send same request multiple times.
Implementations
sourceimpl FrozenClientRequest
impl FrozenClientRequest
sourcepub fn get_method(&self) -> &Method
pub fn get_method(&self) -> &Method
Get HTTP method of this request
sourcepub fn send_body<B>(&self, body: B) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
where
B: MessageBody + 'static,
pub fn send_body<B>(&self, body: B) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
where
B: MessageBody + 'static,
Send a body.
sourcepub fn send_json<T: Serialize>(&self, value: &T) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
pub fn send_json<T: Serialize>(&self, value: &T) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
Send a json body.
sourcepub fn send_form<T: Serialize>(&self, value: &T) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
pub fn send_form<T: Serialize>(&self, value: &T) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
Send an urlencoded body.
sourcepub fn send_stream<S, E>(&self, stream: S) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
where
S: Stream<Item = Result<Bytes, E>> + 'static,
E: Into<Box<dyn Error>> + 'static,
pub fn send_stream<S, E>(&self, stream: S) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
where
S: Stream<Item = Result<Bytes, E>> + 'static,
E: Into<Box<dyn Error>> + 'static,
Send a streaming body.
sourcepub fn send(&self) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
pub fn send(&self) -> SendClientRequestⓘNotable traits for SendClientRequestimpl Future for SendClientRequest type Output = Result<ClientResponse<Decoder<Payload>>, SendRequestError>;
Send an empty body.
sourcepub fn extra_headers(&self, extra_headers: HeaderMap) -> FrozenSendBuilder
pub fn extra_headers(&self, extra_headers: HeaderMap) -> FrozenSendBuilder
Clones this FrozenClientRequest
, returning a new one with extra headers added.
sourcepub fn extra_header(&self, header: impl TryIntoHeaderPair) -> FrozenSendBuilder
pub fn extra_header(&self, header: impl TryIntoHeaderPair) -> FrozenSendBuilder
Clones this FrozenClientRequest
, returning a new one with the extra header added.
Trait Implementations
sourceimpl Clone for FrozenClientRequest
impl Clone for FrozenClientRequest
sourcefn clone(&self) -> FrozenClientRequest
fn clone(&self) -> FrozenClientRequest
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for FrozenClientRequest
impl !Send for FrozenClientRequest
impl !Sync for FrozenClientRequest
impl Unpin for FrozenClientRequest
impl !UnwindSafe for FrozenClientRequest
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more