Struct ServerConnection
pub struct ServerConnection<IO> { /* private fields */ }icap and std only.Expand description
A sequential ICAP server over one established byte stream.
ServerConnection::accept returns a transaction which streams request
body data and makes the Preview decision explicit. Dropping any
transaction before its response completes poisons the connection.
Implementations§
§impl<IO> ServerConnection<IO>
impl<IO> ServerConnection<IO>
pub fn new(io: IO) -> ServerConnection<IO>
pub fn new(io: IO) -> ServerConnection<IO>
Wrap an accepted stream with default connection options.
Bare streams can use rama_core::ServiceInput to supply the Rama
connection extension store required by this protocol wrapper.
pub fn with_options(io: IO, options: ConnectionOptions) -> ServerConnection<IO>
pub fn with_options(io: IO, options: ConnectionOptions) -> ServerConnection<IO>
Wrap an accepted stream with explicit bounds and parser policy.
The connection retains the extension store supplied by io.
pub const fn is_reusable(&self) -> bool
pub const fn is_reusable(&self) -> bool
Return whether the next request can be read safely.
pub const fn options(&self) -> &ConnectionOptions
pub const fn options(&self) -> &ConnectionOptions
Return the connection bounds and parser policy.
pub fn into_inner(self) -> IO
pub fn into_inner(self) -> IO
Recover the underlying stream.
Any bytes read ahead by the ICAP decoder are discarded. Use
into_parts to retain them.
pub fn into_parts(self) -> (IO, Bytes)
pub fn into_parts(self) -> (IO, Bytes)
Recover the underlying stream and bytes read ahead by the decoder.
§impl<IO> ServerConnection<IO>
impl<IO> ServerConnection<IO>
pub async fn accept(
&mut self,
) -> Result<Option<ServerTransaction<'_, IO>>, Error>
pub async fn accept( &mut self, ) -> Result<Option<ServerTransaction<'_, IO>>, Error>
Read the next ICAP request head and encapsulated HTTP head sections.
Cancelling this future abandons the connection. This fail-closed rule prevents a partially consumed request head or HTTP prefix from being mistaken for the start of a later transaction.
Trait Implementations§
§impl<IO> ExtensionsRef for ServerConnection<IO>
impl<IO> ExtensionsRef for ServerConnection<IO>
§fn extensions(&self) -> &Extensions
fn extensions(&self) -> &Extensions
Extensions storeAuto Trait Implementations§
impl<IO> !Freeze for ServerConnection<IO>
impl<IO> RefUnwindSafe for ServerConnection<IO>where
FramedIo<IO>: RefUnwindSafe,
impl<IO> Send for ServerConnection<IO>where
FramedIo<IO>: Send,
impl<IO> Sync for ServerConnection<IO>where
FramedIo<IO>: Sync,
impl<IO> Unpin for ServerConnection<IO>where
FramedIo<IO>: Unpin,
impl<IO> UnsafeUnpin for ServerConnection<IO>where
FramedIo<IO>: UnsafeUnpin,
impl<IO> UnwindSafe for ServerConnection<IO>where
FramedIo<IO>: UnwindSafe,
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