Struct Request
pub struct Request { /* private fields */ }
Expand description
A request to establish a Tcp Connection.
This can be used in case you operate on a layer below an application layer such as Http.
Implementations§
§impl Request
impl Request
pub fn with_protocol(self, protocol: Protocol) -> Request
pub fn with_protocol(self, protocol: Protocol) -> Request
Attach an application protocol to this Request
on which the established connection will operate.
pub fn set_protocol(&mut self, protocol: Protocol) -> &mut Request
pub fn set_protocol(&mut self, protocol: Protocol) -> &mut Request
Set an application protocol to this Request
on which the established connection will operate.
pub fn protocol(&self) -> Option<Protocol>
pub fn protocol(&self) -> Option<Protocol>
Return the application protocol on which the established connection will operate, if known.
pub const fn with_http_version(self, version: Version) -> Request
pub const fn with_http_version(self, version: Version) -> Request
Attach an http version as a hint to the application layer.
pub fn set_http_version(&mut self, version: Version) -> &mut Request
pub fn set_http_version(&mut self, version: Version) -> &mut Request
Set an http version as a hint to the application layer.
pub fn http_version(&self) -> Option<Version>
pub fn http_version(&self) -> Option<Version>
Return the http version hint, if defined
pub fn from_parts(parts: Parts) -> Request
pub fn from_parts(parts: Parts) -> Request
pub fn into_parts(self) -> Parts
pub fn into_parts(self) -> Parts
Trait Implementations§
§impl From<&Request> for TransportContext
impl From<&Request> for TransportContext
§fn from(value: &Request) -> TransportContext
fn from(value: &Request) -> TransportContext
Converts to this type from the input type.
§impl From<Request> for TransportContext
impl From<Request> for TransportContext
§fn from(value: Request) -> TransportContext
fn from(value: Request) -> TransportContext
Converts to this type from the input type.
§impl TryRefIntoTransportContext for Request
impl TryRefIntoTransportContext for Request
§type Error = Infallible
type Error = Infallible
The error that can happen when trying to turn the self reference into the TransportContext.
§fn try_ref_into_transport_ctx(
&self,
_ctx: &Context,
) -> Result<TransportContext, <Request as TryRefIntoTransportContext>::Error>
fn try_ref_into_transport_ctx( &self, _ctx: &Context, ) -> Result<TransportContext, <Request as TryRefIntoTransportContext>::Error>
Try to turn the reference to self within the given context into the TransportContext.
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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> ⓘ
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§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>
Create a new
Policy
that returns Action::Follow
only if self
and other
return
Action::Follow
. Read more