Enum SlotValidator
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§
§impl SlotValidator
impl SlotValidator
Trait Implementations§
§impl Clone for SlotValidator
impl Clone for SlotValidator
§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 more§impl Debug for SlotValidator
impl Debug for SlotValidator
§impl<'de> Deserialize<'de> for SlotValidator
impl<'de> Deserialize<'de> for SlotValidator
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SlotValidator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SlotValidator, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl PartialEq for SlotValidator
impl PartialEq for SlotValidator
§impl Serialize for SlotValidator
impl Serialize for SlotValidator
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
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