Skip to main content

Crate topcoat_session

Crate topcoat_session 

Source

Structs§

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.

Enums§

DecodeError
The reason a Token::decode call rejected its input.

Constants§

DEFAULT_LIFETIME
How long a session lives without being refreshed, unless overridden with ConfigBuilder::lifetime: 30 days.

Traits§

TokenStore
The client-side transport for the session token.

Functions§

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.

Type Aliases§

TokenStoreFuture
The future returned by TokenStore methods: a boxed, Send future borrowing the store and the request context.