Skip to main content

Module store

Module store 

Source
Expand description

Where a Session lives. The library never picks a path: the embedder passes an Arc<dyn SessionStore> to Context::new and the context loads the session once, then saves every change it makes (silent SSO refresh, hydra mint, GrabMart login, address changes) through it.

The trait is async (via async_trait) because Context is async and embedders may back it with an async database client; calling a blocking store from inside the context would need a nested runtime. A file-backed store simply does its (small) blocking IO inside the future.

The CLI’s FileSessionStore (session.json, mode 0600) lives in the grabcli binary crate; MemorySessionStore is for tests and embedders that persist elsewhere.

Structs§

MemorySessionStore
A session held in memory. Counts saves (handy in tests).

Traits§

SessionStore
Loads and saves the one Grab session a Context uses. Implementations must never log cookie or token values.