nova-forms 0.1.11

Build online forms with ease.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::cell::LazyCell;
use regex::Regex;
use super::{Field, FieldError, Rule};

pub struct IbanRule;

impl Rule for IbanRule {
    const REGEX: LazyCell<Regex> =
        LazyCell::new(|| Regex::new(r"^[A-Z]{2}[0-9]{2}[a-zA-Z0-9]{11,30}$").unwrap());
    const DEFAULT: &'static str = "CH9300762011623852957";
    const ATTRIBUTES: &'static [(&'static str, &'static str)] = &[("type", "text")];
}

pub type Iban = Field<IbanRule>;
pub type IbanError = FieldError<IbanRule>;