pub trait SessionStoreFactory: Send + Sync {
// Required methods
fn kind(&self) -> &str;
fn build(
&self,
config: &Value,
) -> Result<Arc<dyn SessionStore>, Box<dyn Error + Send + Sync>>;
}Expand description
Factory the visitor consults when it encounters a
global.apl.session_store block in the unified config. Mirrors
praxis_policy_apl_core::step::PdpFactory: each factory advertises a kind()
string matching the YAML block’s kind: field, and build turns the
block into a live store. Registered up front via
crate::AplOptions::session_store_factories; the visitor selects
the active store from config during its global-config walk, before
any route handler captures the store.
build errors are construction-time (bad config, unresolvable
endpoint) and surface as a config-load failure — distinct from the
request-time SessionStoreError the trait methods return.
Required Methods§
Sourcefn build(
&self,
config: &Value,
) -> Result<Arc<dyn SessionStore>, Box<dyn Error + Send + Sync>>
fn build( &self, config: &Value, ) -> Result<Arc<dyn SessionStore>, Box<dyn Error + Send + Sync>>
Build a store from its config block. The whole
global.apl.session_store mapping is passed so the factory can
read its own keys (endpoint, TLS, auth, prefix, TTL, …).
§Errors
Returns the implementation’s own error when a field of the
session_store block is missing or malformed, or when the store cannot be
reached at construction.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".