pub struct Session {
pub id: String,
/* private fields */
}Expand description
A persistent browser session.
Fields§
§id: StringUnique session identifier.
Implementations§
Source§impl Session
impl Session
Sourcepub fn new(
id: String,
context: Box<dyn RenderContext>,
timeout: Duration,
) -> Self
pub fn new( id: String, context: Box<dyn RenderContext>, timeout: Duration, ) -> Self
Create a new session with a browser context.
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if the session has expired.
A session is expired if any of:
- The configured timeout has elapsed since last access
- The session has been idle longer than
IDLE_TIMEOUT(5 min) - The session’s absolute age exceeds
MAX_CONTEXT_AGE(30 min)
Sourcepub fn context_mut(&mut self) -> &mut dyn RenderContext
pub fn context_mut(&mut self) -> &mut dyn RenderContext
Get the browser context for this session.
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl !UnwindSafe for Session
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