#[non_exhaustive]pub struct SessionConfig {
pub channel_capacity: usize,
pub keep_alive: Option<Duration>,
}Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.channel_capacity: usizethe capacity of the channel for the session. Default is 16.
keep_alive: Option<Duration>The session will be closed after this duration of inactivity.
This serves as a safety net for cleaning up sessions whose HTTP
connections have silently dropped (e.g., due to an HTTP/2
RST_STREAM). Without a timeout, such sessions become zombies:
the session worker keeps running indefinitely because the session
handle’s sender is still held in the session manager, preventing
the worker’s event channel from closing.
Defaults to 5 minutes. Set to None to disable (not recommended
for long-running servers behind proxies).
Implementations§
Source§impl SessionConfig
impl SessionConfig
pub const DEFAULT_CHANNEL_CAPACITY: usize = 16
pub const DEFAULT_KEEP_ALIVE: Duration
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 · 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
Source§impl Default for SessionConfig
impl Default for SessionConfig
Source§fn default() -> SessionConfig
fn default() -> SessionConfig
Returns the “default value” for a type. Read more
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