Struct Request
pub struct Request { /* private fields */ }icap and std only.Expand description
An owned, validated ICAP request head and encapsulated prefix.
Implementations§
§impl Request
impl Request
pub fn new(
line: RequestLine<'_>,
headers: &[Header<'_>],
encapsulated: Option<EncapsulatedParts>,
) -> Result<Request, BuildError>
pub fn new( line: RequestLine<'_>, headers: &[Header<'_>], encapsulated: Option<EncapsulatedParts>, ) -> Result<Request, BuildError>
Encode an ICAP request without Preview.
pub fn with_preview(
line: RequestLine<'_>,
headers: &[Header<'_>],
encapsulated: EncapsulatedParts,
preview: Preview,
) -> Result<Request, BuildError>
pub fn with_preview( line: RequestLine<'_>, headers: &[Header<'_>], encapsulated: EncapsulatedParts, preview: Preview, ) -> Result<Request, BuildError>
Encode an ICAP request with an explicit Preview limit.
pub const fn method(&self) -> MethodKind
pub const fn method(&self) -> MethodKind
Return the lifetime-free request method.
pub const fn encapsulated(&self) -> Option<&EncapsulatedParts>
pub const fn encapsulated(&self) -> Option<&EncapsulatedParts>
Return the encapsulated metadata, when present.
pub fn try_with_original_body_len(self, len: u64) -> Result<Request, BuildError>
pub fn try_with_original_body_len(self, len: u64) -> Result<Request, BuildError>
Declare the exact length of the original HTTP entity body.
This is local client metadata and is not encoded on the wire. It
lets the client validate use-original-body in an early 206
response, before the complete original body has been sent.
pub fn try_set_original_body_len(
&mut self,
len: u64,
) -> Result<&mut Request, BuildError>
pub fn try_set_original_body_len( &mut self, len: u64, ) -> Result<&mut Request, BuildError>
Declare the exact length of the original HTTP entity body.
This is local client metadata and is not encoded on the wire. It
lets the client validate use-original-body in an early 206
response, before the complete original body has been sent.
pub const fn original_body_len(&self) -> Option<u64>
pub const fn original_body_len(&self) -> Option<u64>
Return the declared exact original HTTP entity-body length.
pub const fn allows_204(&self) -> bool
pub const fn allows_204(&self) -> bool
Return whether a 204 response was negotiated outside Preview.
pub const fn allows_206(&self) -> bool
pub const fn allows_206(&self) -> bool
Return whether the Partial Content extension was negotiated.
pub const fn allows_icap_trailers(&self) -> bool
pub const fn allows_icap_trailers(&self) -> bool
Return whether the request offers negotiated outer ICAP trailers.
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<RequestHead<'headers, '_>, ParseError>
pub fn parse_head<'headers>( &self, slots: &'headers mut [HeaderSlot], ) -> Result<RequestHead<'headers, '_>, ParseError>
Decode the owned head into caller-provided header slots.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnsafeUnpin 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
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