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§fn clone(&self) -> RefinementRegistry
fn clone(&self) -> RefinementRegistry
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RefinementRegistry
impl Debug for RefinementRegistry
Source§impl Default for RefinementRegistry
impl Default for RefinementRegistry
Source§fn default() -> RefinementRegistry
fn default() -> RefinementRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RefinementRegistry
impl !RefUnwindSafe for RefinementRegistry
impl Send for RefinementRegistry
impl Sync for RefinementRegistry
impl Unpin for RefinementRegistry
impl !UnwindSafe 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