Skip to main content

assert_session_store_conformance

Function assert_session_store_conformance 

Source
pub async fn assert_session_store_conformance(
    store: &dyn SessionStore,
    record: SessionRecord,
)
Expand description

Assert that a SessionStore implementation honors the trait contract.

Drives store through &dyn SessionStore and checks:

  • save then load round-trips the record unchanged
  • delete removes it, after which load returns StorageError::NotFound
  • a second delete of the now-absent id still succeeds (idempotent)

record must use a session id the store does not already hold. Panics with a descriptive message on the first violated invariant.