Enum SaturationPolicy
#[non_exhaustive]pub enum SaturationPolicy {
Wait,
EvictIdleWhenCold,
EvictIdleAfter(Duration),
EvictIdle,
}net only.Expand description
What a MultiplexPool at a connection limit does for a checkout that
needs a new connection: wait, or replace an idle connection, of its own id
at the id’s limit and of any id at the total one.
Closing another connection costs that connection’s next request a new
handshake, so the default waits a little for the checkout’s own connections
first (see Self::EvictIdleAfter for its timer). An idle connection goes
to the checkout that arrived first among those waiting to use it, to replace
it for the total limit and to replace it for its id’s limit.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Wait
Wait for a connection slot; never close another connection for one.
EvictIdleWhenCold
Close the least recently used idle connection only for a checkout none of whose connections can take a stream; others wait for their own.
EvictIdleAfter(Duration)
As Self::EvictIdleWhenCold, and for any checkout that waited this long.
Waits on a tokio timer: the runtime needs its time driver enabled.
EvictIdle
Close the least recently used idle connection whenever a checkout needs a slot.
Trait Implementations§
§impl Clone for SaturationPolicy
impl Clone for SaturationPolicy
§fn clone(&self) -> SaturationPolicy
fn clone(&self) -> SaturationPolicy
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 SaturationPolicy
§impl Debug for SaturationPolicy
impl Debug for SaturationPolicy
§impl Default for SaturationPolicy
impl Default for SaturationPolicy
§fn default() -> SaturationPolicy
fn default() -> SaturationPolicy
impl Eq for SaturationPolicy
§impl PartialEq for SaturationPolicy
impl PartialEq for SaturationPolicy
impl StructuralPartialEq for SaturationPolicy
Auto Trait Implementations§
impl Freeze for SaturationPolicy
impl RefUnwindSafe for SaturationPolicy
impl Send for SaturationPolicy
impl Sync for SaturationPolicy
impl Unpin for SaturationPolicy
impl UnsafeUnpin for SaturationPolicy
impl UnwindSafe for SaturationPolicy
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<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