Skip to main content

Registry

Struct Registry 

Source
pub struct Registry { /* private fields */ }
Expand description

Registry of storage-driver factories, keyed by DriverName per kind.

Each driver crate calls the register_* methods (typically from a single register(&mut Registry) entry point) to make its backends selectable by name. The loader then uses validate to check a StorageConfig and the build_* methods to instantiate the chosen stores.

Implementations§

Source§

impl Registry

Source

pub fn new() -> Self

Create an empty registry with no drivers registered.

Source

pub fn register_policy_store( &mut self, name: impl Into<DriverName>, factory: Box<dyn PolicyStoreFactory>, )

Register a policy-store driver under name.

Source

pub fn register_audit_sink( &mut self, name: impl Into<DriverName>, factory: Box<dyn AuditSinkFactory>, )

Register an audit-sink driver under name.

Source

pub fn register_session_store( &mut self, name: impl Into<DriverName>, factory: Box<dyn SessionStoreFactory>, )

Register a session-store driver under name.

Source

pub fn register_credential_store( &mut self, name: impl Into<DriverName>, factory: Box<dyn CredentialStoreFactory>, )

Register a credential-store driver under name.

Source

pub fn register_rate_limit_counter( &mut self, name: impl Into<DriverName>, factory: Box<dyn RateLimitCounterFactory>, )

Register a rate-limit-counter driver under name.

Source

pub fn register_lifecycle_store( &mut self, name: impl Into<DriverName>, factory: Box<dyn LifecycleStoreFactory>, )

Register a lifecycle-store driver under name.

Source

pub fn policy_store_names(&self) -> Vec<&str>

Names of all registered policy-store drivers, sorted.

Source

pub fn audit_sink_names(&self) -> Vec<&str>

Names of all registered audit-sink drivers, sorted.

Source

pub fn session_store_names(&self) -> Vec<&str>

Names of all registered session-store drivers, sorted.

Source

pub fn credential_store_names(&self) -> Vec<&str>

Names of all registered credential-store drivers, sorted.

Source

pub fn rate_limit_counter_names(&self) -> Vec<&str>

Names of all registered rate-limit-counter drivers, sorted.

Source

pub fn lifecycle_store_names(&self) -> Vec<&str>

Names of all registered lifecycle-store drivers, sorted.

Source

pub fn validate(&self, config: &StorageConfig) -> Result<(), ConfigError>

Check every driver named in config is registered and has a subsection.

Returns the first ConfigError encountered. This is the entry point behind aasm config validate.

Source

pub fn build_policy_store( &self, config: &StorageConfig, ) -> Result<Arc<dyn PolicyStore>, ConfigError>

Build the configured PolicyStore.

Source

pub fn build_audit_sink( &self, config: &StorageConfig, ) -> Result<Arc<dyn AuditSink>, ConfigError>

Build the configured AuditSink.

Source

pub fn build_session_store( &self, config: &StorageConfig, ) -> Result<Arc<dyn SessionStore>, ConfigError>

Build the configured SessionStore.

Source

pub fn build_credential_store( &self, config: &StorageConfig, ) -> Result<Arc<dyn CredentialStore>, ConfigError>

Build the configured CredentialStore.

Source

pub fn build_rate_limit_counter( &self, config: &StorageConfig, ) -> Result<Arc<dyn RateLimitCounter>, ConfigError>

Build the configured RateLimitCounter.

Source

pub fn build_lifecycle_store( &self, config: &StorageConfig, ) -> Result<Arc<dyn LifecycleStore>, ConfigError>

Build the configured LifecycleStore.

Trait Implementations§

Source§

impl Default for Registry

Source§

fn default() -> Registry

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.