pub struct ConstraintRegistry { /* private fields */ }Expand description
Runtime registry for constraint channels.
Implementations§
Source§impl ConstraintRegistry
impl ConstraintRegistry
pub fn new() -> Self
Sourcepub fn register(
&mut self,
id: &str,
channel: Box<dyn ConstraintChannel>,
config: ChannelConfig,
)
pub fn register( &mut self, id: &str, channel: Box<dyn ConstraintChannel>, config: ChannelConfig, )
Register a new constraint channel at runtime.
Sourcepub fn unregister(&mut self, id: &str) -> bool
pub fn unregister(&mut self, id: &str) -> bool
Remove a channel by id.
Sourcepub fn set_enabled(&mut self, id: &str, enabled: bool) -> bool
pub fn set_enabled(&mut self, id: &str, enabled: bool) -> bool
Enable/disable a channel without removing it.
Sourcepub fn update_config(&mut self, id: &str, config: ChannelConfig) -> bool
pub fn update_config(&mut self, id: &str, config: ChannelConfig) -> bool
Update a channel’s config at runtime.
Sourcepub fn active_channels(&self) -> Vec<(&str, &RegisteredChannel)>
pub fn active_channels(&self) -> Vec<(&str, &RegisteredChannel)>
Return all enabled channels (used by SafetyCertifier).
Sourcepub fn active_count(&self) -> usize
pub fn active_count(&self) -> usize
Number of active (enabled) channels.
Sourcepub fn list_all(&self) -> Vec<ChannelSummary>
pub fn list_all(&self) -> Vec<ChannelSummary>
List all channels with their config (for UI rendering).
Sourcepub fn export(&self) -> Vec<ChannelSummary>
pub fn export(&self) -> Vec<ChannelSummary>
Export all channel definitions as JSON (for constraint management API).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConstraintRegistry
impl !RefUnwindSafe for ConstraintRegistry
impl Send for ConstraintRegistry
impl Sync for ConstraintRegistry
impl Unpin for ConstraintRegistry
impl UnsafeUnpin for ConstraintRegistry
impl !UnwindSafe for ConstraintRegistry
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