pub struct SessionConfig {
pub max_sessions: usize,
pub max_turns_per_session: usize,
pub ttl: Duration,
}Expand description
Bounds that keep a long-lived SessionStore from growing without limit.
A 0 value (or Duration::ZERO for ttl) disables
that particular bound. Eviction is applied lazily on each
record: expired sessions are pruned first, the
touched session’s turns are capped, then least-recently-active sessions are
evicted until the store is within max_sessions.
Fields§
§max_sessions: usizeMaximum number of concurrent sessions retained. Oldest (least recently
active) sessions are evicted past this. 0 disables the cap.
max_turns_per_session: usizeMaximum number of turns kept per session. Oldest turns are dropped past
this. 0 disables the cap.
ttl: DurationHow long a session may remain idle before it is pruned. Duration::ZERO
disables expiry.
Trait Implementations§
Source§impl Clone for SessionConfig
impl Clone for SessionConfig
Source§fn clone(&self) -> SessionConfig
fn clone(&self) -> SessionConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 SessionConfig
impl Debug for SessionConfig
Auto Trait Implementations§
impl Freeze for SessionConfig
impl RefUnwindSafe for SessionConfig
impl Send for SessionConfig
impl Sync for SessionConfig
impl Unpin for SessionConfig
impl UnsafeUnpin for SessionConfig
impl UnwindSafe for SessionConfig
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