Struct carapax::session::SessionCollector
source · pub struct SessionCollector<B> { /* private fields */ }
Available on crate feature
session
only.Expand description
Garbage collector for sessions
Implementations§
source§impl<B> SessionCollector<B>where
B: SessionBackend,
impl<B> SessionCollector<B>where
B: SessionBackend,
sourcepub fn new(
backend: B,
period: Duration,
lifetime: Duration
) -> SessionCollector<B>
pub fn new( backend: B, period: Duration, lifetime: Duration ) -> SessionCollector<B>
Creates a new collector
GC allows to remove all sessions with age longer than given lifetime
§Arguments
- backend - Store backend
- period - Interval between GC calls
- lifetime - Minimum session lifetime
sourcepub fn get_handle(&self) -> SessionCollectorHandle
pub fn get_handle(&self) -> SessionCollectorHandle
Returns a session collector handle
Auto Trait Implementations§
impl<B> Freeze for SessionCollector<B>where
B: Freeze,
impl<B> !RefUnwindSafe for SessionCollector<B>
impl<B> Send for SessionCollector<B>where
B: Send,
impl<B> Sync for SessionCollector<B>where
B: Sync,
impl<B> Unpin for SessionCollector<B>where
B: Unpin,
impl<B> !UnwindSafe for SessionCollector<B>
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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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