pub struct RefinementRegistry { /* private fields */ }Expand description
Registry for managing refinement types.
Implementations§
Source§impl RefinementRegistry
impl RefinementRegistry
Sourcepub fn with_builtins() -> Self
pub fn with_builtins() -> Self
Create a registry with common built-in refinement types.
Sourcepub fn register(&mut self, refinement: RefinementType)
pub fn register(&mut self, refinement: RefinementType)
Register a refinement type.
Sourcepub fn get(&self, name: &str) -> Option<&RefinementType>
pub fn get(&self, name: &str) -> Option<&RefinementType>
Get a refinement type by name.
Sourcepub fn type_names(&self) -> Vec<&str>
pub fn type_names(&self) -> Vec<&str>
Get all registered type names.
Sourcepub fn check(&self, type_name: &str, value: f64) -> Option<bool>
pub fn check(&self, type_name: &str, value: f64) -> Option<bool>
Check if a value satisfies a refinement type by name.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&str, &RefinementType)>
pub fn iter(&self) -> impl Iterator<Item = (&str, &RefinementType)>
Iterate over all refinement types.
Trait Implementations§
Source§impl Clone for RefinementRegistry
impl Clone for RefinementRegistry
Source§impl Debug for RefinementRegistry
impl Debug for RefinementRegistry
Auto Trait Implementations§
impl !RefUnwindSafe for RefinementRegistry
impl !UnwindSafe for RefinementRegistry
impl Freeze for RefinementRegistry
impl Send for RefinementRegistry
impl Sync for RefinementRegistry
impl Unpin for RefinementRegistry
impl UnsafeUnpin for RefinementRegistry
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