Struct PeekPolicy
pub struct PeekPolicy { /* private fields */ }std only.Expand description
Decides what a PeekCutoff does, given the PeekProgress of the ingress peek.
Definitive verdicts (match, reject, EOF, size limits) are not affected,
and PeekCutoff::Aborted always fails.
Implementations§
§impl PeekPolicy
impl PeekPolicy
pub const FAIL_OPEN: PeekPolicy
pub const FAIL_OPEN: PeekPolicy
A cancelled scope and a closed egress invoke the fallback.
An egress mismatch invokes the fallback for idle input and is ignored for partial input, as the client already started the protocol. This is the default.
pub const FAIL_CLOSED: PeekPolicy
pub const FAIL_CLOSED: PeekPolicy
A cancelled scope fails the peek.
Egress cutoffs behave as in Self::FAIL_OPEN.
pub const fn action(
&self,
cutoff: PeekCutoff,
progress: PeekProgress,
) -> PeekAction
pub const fn action( &self, cutoff: PeekCutoff, progress: PeekProgress, ) -> PeekAction
The PeekAction for cutoff at progress.
pub const fn with_cancelled_idle(self, action: PeekAction) -> PeekPolicy
pub const fn with_cancelled_idle(self, action: PeekAction) -> PeekPolicy
Set the action for a cancelled scope before any byte was peeked.
pub fn set_cancelled_idle(&mut self, action: PeekAction) -> &mut PeekPolicy
pub fn set_cancelled_idle(&mut self, action: PeekAction) -> &mut PeekPolicy
Set the action for a cancelled scope before any byte was peeked.
pub const fn with_cancelled_partial(self, action: PeekAction) -> PeekPolicy
pub const fn with_cancelled_partial(self, action: PeekAction) -> PeekPolicy
Set the action for a cancelled scope after a partial peek.
pub fn set_cancelled_partial(&mut self, action: PeekAction) -> &mut PeekPolicy
pub fn set_cancelled_partial(&mut self, action: PeekAction) -> &mut PeekPolicy
Set the action for a cancelled scope after a partial peek.
pub const fn with_egress_mismatch_idle(self, action: PeekAction) -> PeekPolicy
pub const fn with_egress_mismatch_idle(self, action: PeekAction) -> PeekPolicy
Set the action for an egress mismatch before any byte was peeked.
pub fn set_egress_mismatch_idle(
&mut self,
action: PeekAction,
) -> &mut PeekPolicy
pub fn set_egress_mismatch_idle( &mut self, action: PeekAction, ) -> &mut PeekPolicy
Set the action for an egress mismatch before any byte was peeked.
pub const fn with_egress_mismatch_partial(
self,
action: PeekAction,
) -> PeekPolicy
pub const fn with_egress_mismatch_partial( self, action: PeekAction, ) -> PeekPolicy
Set the action for an egress mismatch after a partial peek.
pub fn set_egress_mismatch_partial(
&mut self,
action: PeekAction,
) -> &mut PeekPolicy
pub fn set_egress_mismatch_partial( &mut self, action: PeekAction, ) -> &mut PeekPolicy
Set the action for an egress mismatch after a partial peek.
pub const fn with_egress_closed_idle(self, action: PeekAction) -> PeekPolicy
pub const fn with_egress_closed_idle(self, action: PeekAction) -> PeekPolicy
Set the action for a closed egress before any byte was peeked.
pub fn set_egress_closed_idle(&mut self, action: PeekAction) -> &mut PeekPolicy
pub fn set_egress_closed_idle(&mut self, action: PeekAction) -> &mut PeekPolicy
Set the action for a closed egress before any byte was peeked.
pub const fn with_egress_closed_partial(self, action: PeekAction) -> PeekPolicy
pub const fn with_egress_closed_partial(self, action: PeekAction) -> PeekPolicy
Set the action for a closed egress after a partial peek.
pub fn set_egress_closed_partial(
&mut self,
action: PeekAction,
) -> &mut PeekPolicy
pub fn set_egress_closed_partial( &mut self, action: PeekAction, ) -> &mut PeekPolicy
Set the action for a closed egress after a partial peek.
Trait Implementations§
§impl Clone for PeekPolicy
impl Clone for PeekPolicy
§fn clone(&self) -> PeekPolicy
fn clone(&self) -> PeekPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for PeekPolicy
§impl Debug for PeekPolicy
impl Debug for PeekPolicy
§impl Default for PeekPolicy
impl Default for PeekPolicy
§fn default() -> PeekPolicy
fn default() -> PeekPolicy
impl Eq for PeekPolicy
§impl PartialEq for PeekPolicy
impl PartialEq for PeekPolicy
§impl<Input> PeekPolicyProvider<Input> for PeekPolicy
impl<Input> PeekPolicyProvider<Input> for PeekPolicy
§fn peek_policy(&self, _input: &Input) -> PeekPolicy
fn peek_policy(&self, _input: &Input) -> PeekPolicy
PeekPolicy to apply while peeking input.impl StructuralPartialEq for PeekPolicy
Auto Trait Implementations§
impl Forget for PeekPolicy
impl Freeze for PeekPolicy
impl Move for PeekPolicy
impl RefUnwindSafe for PeekPolicy
impl Send for PeekPolicy
impl Sync for PeekPolicy
impl Unpin for PeekPolicy
impl UnsafeUnpin for PeekPolicy
impl UnwindSafe for PeekPolicy
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§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