Struct AsciiDenyList
#[repr(transparent)]
pub struct AsciiDenyList { /* private fields */ }
The ASCII deny list to be applied.
Implementations
impl AsciiDenyList
const fn new(deny_glyphless: bool, deny_list: &str) -> SelfComputes (preferably at compile time) an ASCII deny list.
Setting
deny_glyphlesstotruedenies U+0020 SPACE and below as well as U+007F DELETE for convenience without having to list these characters in thedeny_liststring.deny_listis the list of ASCII characters to deny. This list must not contain any of:- Letters
- Digits
- Hyphen
- Dot (period / full-stop)
- Non-ASCII
Panics
If the deny list contains characters listed as prohibited above.
const EMPTY: Self = _;No ASCII deny list. This corresponds to UseSTD3ASCIIRules=false.
Equivalent to
AsciiDenyList::new(false, "").Note: Not denying the space and control characters can result in strange behavior. Without a deny list provided to the UTS 46 operation, the caller is expected perform filtering afterwards, but it's more efficient to use
AsciiDenyListthan post-processing, because the internals of this crate can optimize away checks in certain cases.const STD3: Self = _;The STD3 deny list. This corresponds to UseSTD3ASCIIRules=true.
Note that this deny list rejects the underscore, which occurs in pseudo-hosts used by various TXT record-based protocols, and also characters that may occurs in non-DNS naming, such as NetBIOS.
const URL: Self = _;Forbidden domain code point from the WHATWG URL Standard.
Equivalent to
AsciiDenyList::new(true, "%#/:<>?@[\\]^|").Note that this deny list rejects IPv6 addresses, so (as in URL parsing) you need to check for IPv6 addresses first and not put them through UTS 46 processing.
Trait Implementations
impl Clone for AsciiDenyList
fn clone(&self) -> Self
impl Copy for AsciiDenyList
impl Eq for AsciiDenyList
impl PartialEq for AsciiDenyList
fn eq(&self, other: &Self) -> bool