Skip to main contentCrate topcoat_session
Source - Config
- Session configuration, registered on the app context (with the router’s
sessions extension method). - ConfigBuilder
- Assembles a
Config. Created with Config::builder. - Rotation
- The outcome of
rotate: the replacement session and the hash it
replaces. - Session
- A session as the application should record it, returned by
start,
refresh, and rotate. - SessionState
- The request-scoped session cell, registered on the request context by the
session layer (or manually via
CxTestBuilder in tests). - Token
- A session token: 32 bytes of cryptographically secure randomness, held by
the client as its proof of a session.
- TokenHash
- The SHA-256 hash of a
Token, identifying a session.
- DecodeError
- The reason a
Token::decode call rejected its input.
- DEFAULT_LIFETIME
- How long a session lives without being refreshed, unless overridden with
ConfigBuilder::lifetime: 30 days.
- TokenStore
- The client-side transport for the session token.
- refresh
- Extends the current session’s lifetime without changing its token.
- rotate
- Replaces the current session’s token with a fresh one.
- start
- Starts a new session, issuing a fresh token to the client.
- stop
- Stops the current session, instructing the client to discard its token.
- token_hash
- Returns the hash identifying the current request’s session, or
None
when the request carries no (valid) token.
- TokenStoreFuture
- The future returned by
TokenStore methods: a boxed, Send future
borrowing the store and the request context.