Struct Response
pub struct Response { /* private fields */ }icap and std only.Expand description
An owned, validated ICAP response head and encapsulated prefix.
Implementations§
§impl Response
impl Response
pub fn from_head_bytes(
method: MethodKind,
bytes: Bytes,
headers: &mut [HeaderSlot],
parser: HeadParserConfig,
encapsulated: Option<EncapsulatedParts>,
) -> Result<Response, ParseError>
pub fn from_head_bytes( method: MethodKind, bytes: Bytes, headers: &mut [HeaderSlot], parser: HeadParserConfig, encapsulated: Option<EncapsulatedParts>, ) -> Result<Response, ParseError>
Construct a response from a complete, validated wire head.
The separately framed encapsulated prefix must already have been
converted into EncapsulatedParts. Its derived sections must match
the head’s Encapsulated field. The parser policy is retained so later
calls to Response::parse_head use the same accepted syntax.
pub fn new(
method: MethodKind,
line: ResponseLine<'_>,
headers: &[Header<'_>],
encapsulated: Option<EncapsulatedParts>,
) -> Result<Response, BuildError>
pub fn new( method: MethodKind, line: ResponseLine<'_>, headers: &[Header<'_>], encapsulated: Option<EncapsulatedParts>, ) -> Result<Response, BuildError>
Encode an ICAP response for the corresponding request method.
pub fn new_with_icap_trailer_names(
method: MethodKind,
line: ResponseLine<'_>,
headers: &[Header<'_>],
encapsulated: EncapsulatedParts,
names: IcapTrailerNames,
) -> Result<Response, BuildError>
pub fn new_with_icap_trailer_names( method: MethodKind, line: ResponseLine<'_>, headers: &[Header<'_>], encapsulated: EncapsulatedParts, names: IcapTrailerNames, ) -> Result<Response, BuildError>
Encode a response that promises a separate outer ICAP trailer block.
The response automatically advertises Allow: trailers. The actual
outer fields are supplied when the streaming body is finished.
pub const fn method(&self) -> MethodKind
pub const fn method(&self) -> MethodKind
Return the corresponding request method.
pub const fn status(&self) -> StatusCode
pub const fn status(&self) -> StatusCode
Return the response status.
pub const fn encapsulated(&self) -> Option<&EncapsulatedParts>
pub const fn encapsulated(&self) -> Option<&EncapsulatedParts>
Return the encapsulated metadata, when present.
pub const fn allows_icap_trailers(&self) -> bool
pub const fn allows_icap_trailers(&self) -> bool
Return whether this response advertises support for outer ICAP trailers.
pub const fn icap_trailer_names(&self) -> Option<&IcapTrailerNames>
pub const fn icap_trailer_names(&self) -> Option<&IcapTrailerNames>
Return the names promised for the outer ICAP trailer block.
pub const fn head_bytes(&self) -> &Bytes
pub const fn head_bytes(&self) -> &Bytes
Return the encoded ICAP head.
pub const fn should_close(&self) -> bool
pub const fn should_close(&self) -> bool
Return whether this message asks to close the connection.
pub fn parse_head<'headers>(
&self,
slots: &'headers mut [HeaderSlot],
) -> Result<ResponseHead<'headers, '_>, ParseError>
pub fn parse_head<'headers>( &self, slots: &'headers mut [HeaderSlot], ) -> Result<ResponseHead<'headers, '_>, ParseError>
Decode the owned head into caller-provided header slots.
Trait Implementations§
§impl From<Response> for OutgoingResponse
impl From<Response> for OutgoingResponse
§fn from(value: Response) -> OutgoingResponse
fn from(value: Response) -> OutgoingResponse
Auto Trait Implementations§
impl !Freeze for Response
impl RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl UnsafeUnpin for Response
impl UnwindSafe for Response
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
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> ⓘ
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