Skip to main content

IntoRules

Trait IntoRules 

Source
pub trait IntoRules {
    // Required method
    fn into_rules(self) -> Rules;
}
Expand description

Anything that can name a rule set when registering a field.

This is what lets validator.rule("email", "required|email") and validator.rule("email", Rule::required().email()) sit side by side.

Required Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl IntoRules for &str

A malformed spec is a bug in the source, not bad user input, so it panics with the parser’s message rather than turning into a validation error a user would see. Use Rules::parse directly when the spec comes from data.

Source§

impl IntoRules for String

Implementors§