pub struct EncryptionRegistry { /* private fields */ }Expand description
加密器注册表
管理加密器的注册和查找
Implementations§
Source§impl EncryptionRegistry
impl EncryptionRegistry
Sourcepub fn register_defaults(&self)
pub fn register_defaults(&self)
注册内置加密器
Sourcepub fn register(&self, name: &str, encryptor: Arc<dyn Encryptor>)
pub fn register(&self, name: &str, encryptor: Arc<dyn Encryptor>)
注册加密器
§参数
name: 加密器名称(用于查找)encryptor: 加密器实例
§示例
ⓘ
use flare_core::common::encryption::{EncryptionRegistry, Encryptor};
use std::sync::Arc;
struct MyEncryptor;
impl Encryptor for MyEncryptor { /* ... */ }
let registry = EncryptionRegistry::new();
registry.register("my_custom", Arc::new(MyEncryptor));Sourcepub fn is_registered(&self, name: &str) -> bool
pub fn is_registered(&self, name: &str) -> bool
Sourcepub fn list_registered(&self) -> Vec<String>
pub fn list_registered(&self) -> Vec<String>
Source§impl EncryptionRegistry
全局加密器注册表访问器
impl EncryptionRegistry
全局加密器注册表访问器
Sourcepub fn global() -> &'static EncryptionRegistry
pub fn global() -> &'static EncryptionRegistry
获取全局注册表实例
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EncryptionRegistry
impl RefUnwindSafe for EncryptionRegistry
impl Send for EncryptionRegistry
impl Sync for EncryptionRegistry
impl Unpin for EncryptionRegistry
impl UnsafeUnpin for EncryptionRegistry
impl UnwindSafe for EncryptionRegistry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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