[][src]Function password_rules_parser::parse_password_rules

pub fn parse_password_rules(
    s: &str,
    supply_default: bool
) -> Result<PasswordRules, PasswordRulesError>

Parse a password rules string and return its parts

All character requirements will be "canonicalized", which means redundant requirements will be collapsed. For instance, "allow: ascii-printable, upper" will be parsed the same as "allow: ascii-printable".

If supply_default is given, AsciiPrintable is added to the set of allowed characters if both the allowed and required sets are empty; this behavior is consistent with the specification requirements.