Struct ServerResponse
pub struct ServerResponse<'a, IO> { /* private fields */ }icap and std only.Expand description
A streaming final response being sent by an ICAP server.
Implementations§
§impl<IO> ServerResponse<'_, IO>
impl<IO> ServerResponse<'_, IO>
pub async fn next_request_data(&mut self) -> Result<Option<Bytes>, Error>
pub async fn next_request_data(&mut self) -> Result<Option<Bytes>, Error>
Read the next unread request-body data segment.
This is intended for a response created by
ServerTransaction::respond_streaming. A returned segment is a
zero-copy Bytes view. None marks the current body boundary; use
request_body_end to distinguish a complete
body from an incomplete Preview.
pub const fn request_body_end(&self) -> Option<BodyEnd>
pub const fn request_body_end(&self) -> Option<BodyEnd>
Return the terminal state of the unread request body.
pub fn request_trailers(&self) -> Option<&TrailerBlock>
pub fn request_trailers(&self) -> Option<&TrailerBlock>
Return trailers from the unread request body.
pub async fn write_data(&mut self, data: &[u8]) -> Result<(), Error>
pub async fn write_data(&mut self, data: &[u8]) -> Result<(), Error>
Write one response entity-body data segment as an ICAP chunk.
pub async fn finish_with_trailers(
self,
trailers: &TrailerBlock,
) -> Result<(), Error>
pub async fn finish_with_trailers( self, trailers: &TrailerBlock, ) -> Result<(), Error>
Finish a response with negotiated HTTP trailers.
pub async fn finish_with_trailer_blocks(
self,
http_trailers: &TrailerBlock,
icap_trailers: Option<&TrailerBlock>,
) -> Result<(), Error>
pub async fn finish_with_trailer_blocks( self, http_trailers: &TrailerBlock, icap_trailers: Option<&TrailerBlock>, ) -> Result<(), Error>
Finish a response with separate HTTP and outer ICAP trailer blocks.
icap_trailers is valid only when the response head promised outer
ICAP trailer names. A promised response without actual outer fields
emits the c-icap-compatible empty sentinel.
pub async fn finish_partial(self, use_original_body: u64) -> Result<(), Error>
pub async fn finish_partial(self, use_original_body: u64) -> Result<(), Error>
Finish a 206 response with its original-body resume offset.
pub async fn finish_partial_with_trailers(
self,
use_original_body: u64,
trailers: &TrailerBlock,
) -> Result<(), Error>
pub async fn finish_partial_with_trailers( self, use_original_body: u64, trailers: &TrailerBlock, ) -> Result<(), Error>
Finish a 206 response with negotiated HTTP trailers.
pub async fn finish_partial_with_trailer_blocks(
self,
use_original_body: u64,
http_trailers: &TrailerBlock,
icap_trailers: Option<&TrailerBlock>,
) -> Result<(), Error>
pub async fn finish_partial_with_trailer_blocks( self, use_original_body: u64, http_trailers: &TrailerBlock, icap_trailers: Option<&TrailerBlock>, ) -> Result<(), Error>
Finish a 206 response with separate HTTP and outer ICAP trailer blocks.
Trait Implementations§
§impl<IO> ExtensionsRef for ServerResponse<'_, IO>
impl<IO> ExtensionsRef for ServerResponse<'_, IO>
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions storeAuto Trait Implementations§
impl<'a, IO> !Freeze for ServerResponse<'a, IO>
impl<'a, IO> !UnwindSafe for ServerResponse<'a, IO>
impl<'a, IO> RefUnwindSafe for ServerResponse<'a, IO>where
&'a mut ServerConnection<IO>: RefUnwindSafe,
impl<'a, IO> Send for ServerResponse<'a, IO>where
&'a mut ServerConnection<IO>: Send,
impl<'a, IO> Sync for ServerResponse<'a, IO>where
&'a mut ServerConnection<IO>: Sync,
impl<'a, IO> Unpin for ServerResponse<'a, IO>where
&'a mut ServerConnection<IO>: Unpin,
impl<'a, IO> UnsafeUnpin for ServerResponse<'a, IO>where
&'a mut ServerConnection<IO>: 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