Struct Encapsulated
pub struct Encapsulated { /* private fields */ }http and icap only.Expand description
Parsed HTTP heads and body role from an ICAP Encapsulated value.
Implementations§
§impl Encapsulated
impl Encapsulated
pub fn parse(parts: &EncapsulatedParts) -> Result<Encapsulated, Error>
pub fn parse(parts: &EncapsulatedParts) -> Result<Encapsulated, Error>
Parse the typed HTTP heads with the default bounded parser.
pub fn parse_with(
parts: &EncapsulatedParts,
parser: &HeadParser,
) -> Result<Encapsulated, Error>
pub fn parse_with( parts: &EncapsulatedParts, parser: &HeadParser, ) -> Result<Encapsulated, Error>
Parse the typed HTTP heads with an explicit parser configuration.
pub fn from_request<T>(
request: &Request<T>,
body_kind: EncapsulatedKind,
) -> Result<EncapsulatedParts, Error>
pub fn from_request<T>( request: &Request<T>, body_kind: EncapsulatedKind, ) -> Result<EncapsulatedParts, Error>
Encode an encapsulated HTTP request head.
Connection-specific fields are omitted as required by ICAP, except an
Upgrade, see UpgradeEncapsulation. If the
head contains HTTP proxy credentials, a complete ICAP message must
carry them as ICAP headers instead.
pub fn from_response<T>(
response: &Response<T>,
body_kind: EncapsulatedKind,
) -> Result<EncapsulatedParts, Error>
pub fn from_response<T>( response: &Response<T>, body_kind: EncapsulatedKind, ) -> Result<EncapsulatedParts, Error>
Encode an encapsulated HTTP response head.
Connection-specific fields are omitted as required by ICAP, except an
Upgrade, see UpgradeEncapsulation. If the
head contains an HTTP proxy challenge, a complete ICAP message must
carry it as an ICAP header instead.
pub fn from_request_response<R, S>(
request: &Request<R>,
response: &Response<S>,
body_kind: EncapsulatedKind,
) -> Result<EncapsulatedParts, Error>
pub fn from_request_response<R, S>( request: &Request<R>, response: &Response<S>, body_kind: EncapsulatedKind, ) -> Result<EncapsulatedParts, Error>
Encode original request and response heads around a response body.
Connection-specific fields are omitted as required by ICAP, except an
Upgrade, see UpgradeEncapsulation. If the
request contains HTTP proxy credentials or the response contains a
proxy challenge, a complete ICAP message must carry them as ICAP
headers instead. This helper returns only the encapsulated message and
therefore does not preserve those fields itself.
pub const fn request(&self) -> Option<&Request<()>>
pub const fn request(&self) -> Option<&Request<()>>
Return the encapsulated HTTP request head, when present.
pub const fn request_mut(&mut self) -> Option<&mut Request<()>>
pub const fn request_mut(&mut self) -> Option<&mut Request<()>>
Return the mutable encapsulated HTTP request head, when present.
pub const fn response(&self) -> Option<&Response<()>>
pub const fn response(&self) -> Option<&Response<()>>
Return the encapsulated HTTP response head, when present.
pub const fn response_mut(&mut self) -> Option<&mut Response<()>>
pub const fn response_mut(&mut self) -> Option<&mut Response<()>>
Return the mutable encapsulated HTTP response head, when present.
pub const fn body_kind(&self) -> EncapsulatedKind
pub const fn body_kind(&self) -> EncapsulatedKind
Return which entity body follows the HTTP heads.
pub fn into_parts(self) -> ParsedEncapsulatedParts
pub fn into_parts(self) -> ParsedEncapsulatedParts
Split the parsed HTTP metadata into its parts.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Encapsulated
impl !UnwindSafe for Encapsulated
impl Forget for Encapsulated
impl Freeze for Encapsulatedwhere
*const [u8] is !null: Freeze,
PhantomData<[u8]>: Freeze,
*const ArcInner<LazyUriRef> is !null: Freeze,
PhantomData<ArcInner<LazyUriRef>>: Freeze,
*const ArcInner<OwnedUriRef> is !null: Freeze,
PhantomData<ArcInner<OwnedUriRef>>: Freeze,
*const [Pos] is !null: Freeze,
PhantomData<[Pos]>: Freeze,
*const u8 is !null: Freeze,
PhantomData<Bucket<HeaderValue>>: Freeze,
PhantomData<ExtraValue<HeaderValue>>: Freeze,
PhantomData<Option<Link>>: Freeze,
*const ColdState is !null: Freeze,
PhantomData<ColdState>: Freeze,
*const ArcInner<Node> is !null: Freeze,
PhantomData<ArcInner<Node>>: Freeze,
NonZero<u16>: Freeze,
impl Move for Encapsulated
impl Send for Encapsulated
impl Sync for Encapsulated
impl Unpin for Encapsulated
impl UnsafeUnpin for Encapsulatedwhere
*const [u8] is !null: UnsafeUnpin,
PhantomData<[u8]>: UnsafeUnpin,
*const ArcInner<LazyUriRef> is !null: UnsafeUnpin,
PhantomData<ArcInner<LazyUriRef>>: UnsafeUnpin,
*const ArcInner<OwnedUriRef> is !null: UnsafeUnpin,
PhantomData<ArcInner<OwnedUriRef>>: UnsafeUnpin,
*const [Pos] is !null: UnsafeUnpin,
PhantomData<[Pos]>: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Bucket<HeaderValue>>: UnsafeUnpin,
PhantomData<ExtraValue<HeaderValue>>: UnsafeUnpin,
PhantomData<Option<Link>>: UnsafeUnpin,
*const ColdState is !null: UnsafeUnpin,
PhantomData<ColdState>: UnsafeUnpin,
*const ArcInner<Node> is !null: UnsafeUnpin,
PhantomData<ArcInner<Node>>: UnsafeUnpin,
NonZeroU16Inner: UnsafeUnpin,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§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