Skip to main content

max_len

Function max_len 

Source
pub fn max_len(
    n: usize,
    msg: impl Into<String>,
) -> impl Fn(&str) -> Result<(), String>
Expand description

Require at most n characters (counted as Unicode scalar values).

ยงExample

let field = FormField::new("Bio").validate(validators::max_len(140, "max 140 chars"));