pub struct ValidationRuleRegistry { /* private fields */ }Expand description
Validation rule registry tracking inheritance relationships.
Implementations§
Source§impl ValidationRuleRegistry
impl ValidationRuleRegistry
Sourcepub fn register_type(
&mut self,
type_name: impl Into<String>,
rules: Vec<RuleMetadata>,
)
pub fn register_type( &mut self, type_name: impl Into<String>, rules: Vec<RuleMetadata>, )
Register rules for a type.
Sourcepub fn set_parent(
&mut self,
child_type: impl Into<String>,
parent_type: impl Into<String>,
)
pub fn set_parent( &mut self, child_type: impl Into<String>, parent_type: impl Into<String>, )
Set the parent type for inheritance.
Sourcepub fn get_rules(
&self,
type_name: &str,
mode: InheritanceMode,
) -> Vec<RuleMetadata>
pub fn get_rules( &self, type_name: &str, mode: InheritanceMode, ) -> Vec<RuleMetadata>
Get rules for a type, including inherited rules.
Sourcepub fn get_parent(&self, type_name: &str) -> Option<&str>
pub fn get_parent(&self, type_name: &str) -> Option<&str>
Get the parent type name if one exists.
Sourcepub fn has_parent(&self, type_name: &str) -> bool
pub fn has_parent(&self, type_name: &str) -> bool
Check if a type has a parent.
Trait Implementations§
Source§impl Clone for ValidationRuleRegistry
impl Clone for ValidationRuleRegistry
Source§fn clone(&self) -> ValidationRuleRegistry
fn clone(&self) -> ValidationRuleRegistry
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 ValidationRuleRegistry
impl Debug for ValidationRuleRegistry
Source§impl Default for ValidationRuleRegistry
impl Default for ValidationRuleRegistry
Source§fn default() -> ValidationRuleRegistry
fn default() -> ValidationRuleRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ValidationRuleRegistry
impl RefUnwindSafe for ValidationRuleRegistry
impl Send for ValidationRuleRegistry
impl Sync for ValidationRuleRegistry
impl Unpin for ValidationRuleRegistry
impl UnsafeUnpin for ValidationRuleRegistry
impl UnwindSafe for ValidationRuleRegistry
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