pub struct CompactAlgorithmRegistry { /* private fields */ }Expand description
Resolves CompactionSettings.algorithm names to implementations. Holds the custom
algorithms (host-injected, e.g. TS extensions); the builtin is always available as
fallback.
Implementations§
Source§impl CompactAlgorithmRegistry
impl CompactAlgorithmRegistry
pub fn new() -> Self
Sourcepub fn register(&self, algorithm: Arc<dyn CompactAlgorithm>)
pub fn register(&self, algorithm: Arc<dyn CompactAlgorithm>)
Register a custom algorithm by name. The builtin can never be shadowed.
Sourcepub fn replace_custom(
&self,
algorithms: impl IntoIterator<Item = Arc<dyn CompactAlgorithm>>,
)
pub fn replace_custom( &self, algorithms: impl IntoIterator<Item = Arc<dyn CompactAlgorithm>>, )
Atomically replace every custom algorithm while keeping the builtin fallback available.
Sourcepub fn algorithm(&self, name: &str) -> Arc<dyn CompactAlgorithm> ⓘ
pub fn algorithm(&self, name: &str) -> Arc<dyn CompactAlgorithm> ⓘ
Resolve an algorithm name. Unknown / empty names fall back to the builtin with a warning — a bad setting must never take down the agent.
Sourcepub fn custom_names(&self) -> Vec<String>
pub fn custom_names(&self) -> Vec<String>
Names of all registered custom algorithms (excluding the builtin).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for CompactAlgorithmRegistry
impl !RefUnwindSafe for CompactAlgorithmRegistry
impl !UnwindSafe for CompactAlgorithmRegistry
impl Send for CompactAlgorithmRegistry
impl Sync for CompactAlgorithmRegistry
impl Unpin for CompactAlgorithmRegistry
impl UnsafeUnpin for CompactAlgorithmRegistry
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