Struct SendRequest
struct SendRequest<B> { ... }
The sender side of an established connection.
Implementations
impl<B> SendRequest<B>
fn send_request(self: &mut Self, req: Request<B>) -> impl Future<Output = crate::Result<Response<IncomingBody>>>Sends a
Requeston the associated connection.Returns a future that if successful, yields the
Response.reqmust have aHostheader.Uri
The
Uriof the request is serialized as-is.- Usually you want origin-form (
/path?query). - For sending to an HTTP proxy, you want to send in absolute-form
(
https://hyper.rs/guides).
This is however not enforced or validated and it is up to the user of this method to ensure the
Uriis correct for their intended purpose.- Usually you want origin-form (
fn try_send_request(self: &mut Self, req: Request<B>) -> impl Future<Output = Result<Response<IncomingBody>, TrySendError<Request<B>>>>Sends a
Requeston the associated connection.Returns a future that if successful, yields the
Response.Error
If there was an error before trying to serialize the request to the connection, the message will be returned as part of this error.
impl<B> SendRequest<B>
fn poll_ready(self: &mut Self, cx: &mut Context<'_>) -> Poll<crate::Result<()>>Polls to determine whether this sender can be used yet for a request.
If the associated connection is closed, this returns an Error.
async fn ready(self: &mut Self) -> crate::Result<()>Waits until the dispatcher is ready
If the associated connection is closed, this returns an Error.
fn is_ready(self: &Self) -> boolChecks if the connection is currently ready to send a request.
Note
This is mostly a hint. Due to inherent latency of networks, it is possible that even after checking this is ready, sending a request may still fail because the connection was closed in the meantime.
fn is_closed(self: &Self) -> boolChecks if the connection side has been closed.
impl<B> Debug for SendRequest<B>
fn fmt(self: &Self, f: &mut fmt::Formatter<'_>) -> fmt::Result
impl<B> Freeze for SendRequest<B>
impl<B> RefUnwindSafe for SendRequest<B>
impl<B> Send for SendRequest<B>
impl<B> Sync for SendRequest<B>
impl<B> Unpin for SendRequest<B>
impl<B> UnwindSafe for SendRequest<B>
impl<T> Any for SendRequest<B>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for SendRequest<B>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for SendRequest<B>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> From for SendRequest<B>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> Instrument for SendRequest<B>
impl<T> WithSubscriber for SendRequest<B>
impl<T, U> Into for SendRequest<B>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for SendRequest<B>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for SendRequest<B>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>