pub enum SlotValidator {
Range {
min: Option<f64>,
max: Option<f64>,
},
NonEmpty,
Regex(String),
OneOf(Vec<String>),
}Expand description
A serializable validator applied to a recognized slot value; a value failing it is rejected (the slot stays unfilled until a valid value is recognized).
Variants§
Range
Numeric range with optional inclusive bounds (accepts numbers, or numeric strings).
NonEmpty
A non-empty (after trim) string.
Regex(String)
A string matching this regex pattern.
OneOf(Vec<String>)
One of a fixed set (case-insensitive for strings).
Implementations§
Trait Implementations§
Source§impl Clone for SlotValidator
impl Clone for SlotValidator
Source§fn clone(&self) -> SlotValidator
fn clone(&self) -> SlotValidator
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 SlotValidator
impl Debug for SlotValidator
Source§impl<'de> Deserialize<'de> for SlotValidator
impl<'de> Deserialize<'de> for SlotValidator
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SlotValidator
impl PartialEq for SlotValidator
Source§impl Serialize for SlotValidator
impl Serialize for SlotValidator
impl StructuralPartialEq for SlotValidator
Auto Trait Implementations§
impl Freeze for SlotValidator
impl RefUnwindSafe for SlotValidator
impl Send for SlotValidator
impl Sync for SlotValidator
impl Unpin for SlotValidator
impl UnwindSafe for SlotValidator
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