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. 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. 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. 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 Freeze for Encapsulated
impl RefUnwindSafe for Encapsulated
impl Send for Encapsulated
impl Sync for Encapsulated
impl Unpin for Encapsulated
impl UnsafeUnpin for Encapsulated
impl UnwindSafe for Encapsulated
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