pub struct ExpirationConfig {
pub batch_limit: usize,
pub cleanup_probability: f64,
}Expand description
Configuration for expiration-based garbage collection.
Fields§
§batch_limit: usizeMaximum memories to process in a single GC run.
Prevents long-running GC operations.
cleanup_probability: f64Probability of running cleanup after a capture (0.0 to 1.0).
Set to 0.0 to disable probabilistic cleanup. Set to 1.0 to always run cleanup after capture.
Implementations§
Source§impl ExpirationConfig
impl ExpirationConfig
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
Creates an expiration config from environment variables.
Reads:
SUBCOG_EXPIRATION_BATCH_LIMIT: Batch limit for GC runsSUBCOG_EXPIRATION_CLEANUP_PROBABILITY: Probability of cleanup (0.0-1.0)
Sourcepub const fn with_batch_limit(self, limit: usize) -> Self
pub const fn with_batch_limit(self, limit: usize) -> Self
Sets the batch limit.
Sourcepub fn with_cleanup_probability(self, probability: f64) -> Self
pub fn with_cleanup_probability(self, probability: f64) -> Self
Sets the cleanup probability.
Trait Implementations§
Source§impl Clone for ExpirationConfig
impl Clone for ExpirationConfig
Source§fn clone(&self) -> ExpirationConfig
fn clone(&self) -> ExpirationConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ExpirationConfig
impl Debug for ExpirationConfig
Auto Trait Implementations§
impl Freeze for ExpirationConfig
impl RefUnwindSafe for ExpirationConfig
impl Send for ExpirationConfig
impl Sync for ExpirationConfig
impl Unpin for ExpirationConfig
impl UnwindSafe for ExpirationConfig
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].