pub struct GuardRegistry { /* private fields */ }Expand description
Registry for dynamically registering and creating guards.
The registry enables a plugin architecture where commercial guards can be registered at runtime.
Implementations§
Source§impl GuardRegistry
impl GuardRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Creates a registry with built-in community guards.
Sourcepub fn register<F: DynGuardFactory + 'static>(&mut self, name: &str, factory: F)
pub fn register<F: DynGuardFactory + 'static>(&mut self, name: &str, factory: F)
Registers a guard factory.
Sourcepub fn info(&self, name: &str) -> Option<GuardInfo>
pub fn info(&self, name: &str) -> Option<GuardInfo>
Gets information about a registered guard type.
Sourcepub async fn create(
&self,
name: &str,
config: &GuardFactoryConfig,
) -> LicensedGuardResult<Box<dyn Guard>>
pub async fn create( &self, name: &str, config: &GuardFactoryConfig, ) -> LicensedGuardResult<Box<dyn Guard>>
Creates a guard instance.
Sourcepub async fn create_licensed(
&self,
name: &str,
config: &GuardFactoryConfig,
validator: &LicenseValidator,
) -> LicensedGuardResult<Box<dyn Guard>>
pub async fn create_licensed( &self, name: &str, config: &GuardFactoryConfig, validator: &LicenseValidator, ) -> LicensedGuardResult<Box<dyn Guard>>
Creates a guard instance with license validation.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GuardRegistry
impl !RefUnwindSafe for GuardRegistry
impl Send for GuardRegistry
impl Sync for GuardRegistry
impl Unpin for GuardRegistry
impl !UnwindSafe for GuardRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more