Struct SendRequest
pub struct SendRequest<B> { /* private fields */ }Expand description
The sender side of an established connection.
Implementations§
§impl<B> SendRequest<B>
impl<B> SendRequest<B>
pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Error>>
pub fn poll_ready(&mut self, cx: &mut Context<'_>) -> Poll<Result<(), Error>>
Polls to determine whether this sender can be used yet for a request.
If the associated connection is closed, this returns an Error.
pub async fn ready(&mut self) -> Result<(), Error>
pub async fn ready(&mut self) -> Result<(), Error>
Waits until the dispatcher is ready
If the associated connection is closed, this returns an Error.
§impl<B> SendRequest<B>
impl<B> SendRequest<B>
pub fn send_request(
&mut self,
req: Request<B>,
) -> impl Future<Output = Result<Response<Incoming>, Error>> + use<B>
pub fn send_request( &mut self, req: Request<B>, ) -> impl Future<Output = Result<Response<Incoming>, Error>> + use<B>
Sends a Request on the associated connection.
Returns a future that if successful, yields the Response.
req must have a Host header.
§Uri
The Uri of 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.
This is however not enforced or validated and it is up to the user
of this method to ensure the Uri is correct for their intended purpose.
pub fn try_send_request(
&mut self,
req: Request<B>,
) -> impl Future<Output = Result<Response<Incoming>, TrySendError<Request<B>>>>
pub fn try_send_request( &mut self, req: Request<B>, ) -> impl Future<Output = Result<Response<Incoming>, TrySendError<Request<B>>>>
Sends a Request on 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.
Trait Implementations§
Auto Trait Implementations§
impl<B> !Freeze for SendRequest<B>
impl<B> !RefUnwindSafe for SendRequest<B>
impl<B> Send for SendRequest<B>where
B: Send,
impl<B> Sync for SendRequest<B>where
B: Send,
impl<B> Unpin for SendRequest<B>
impl<B> !UnwindSafe for SendRequest<B>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more