Struct idna::uts46::AsciiDenyList
source · pub struct AsciiDenyList { /* private fields */ }
Expand description
The ASCII deny list to be applied.
Implementations§
source§impl AsciiDenyList
impl AsciiDenyList
sourcepub const fn new(deny_glyphless: bool, deny_list: &str) -> Self
pub const fn new(deny_glyphless: bool, deny_list: &str) -> Self
Computes (preferably at compile time) an ASCII deny list.
Setting deny_glyphless
to true
denies U+0020 SPACE and below
as well as U+007F DELETE for convenience without having to list
these characters in the deny_list
string.
deny_list
is 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.
sourcepub const EMPTY: AsciiDenyList = _
pub const EMPTY: AsciiDenyList = _
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 AsciiDenyList
than post-processing,
because the internals of this crate can optimize away checks in
certain cases.
sourcepub const STD3: AsciiDenyList = _
pub const STD3: AsciiDenyList = _
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.
sourcepub const URL: AsciiDenyList = _
pub const URL: AsciiDenyList = _
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§
source§impl Clone for AsciiDenyList
impl Clone for AsciiDenyList
source§fn clone(&self) -> AsciiDenyList
fn clone(&self) -> AsciiDenyList
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl PartialEq for AsciiDenyList
impl PartialEq for AsciiDenyList
impl Copy for AsciiDenyList
impl Eq for AsciiDenyList
impl StructuralPartialEq for AsciiDenyList
Auto Trait Implementations§
impl Freeze for AsciiDenyList
impl RefUnwindSafe for AsciiDenyList
impl Send for AsciiDenyList
impl Sync for AsciiDenyList
impl Unpin for AsciiDenyList
impl UnwindSafe for AsciiDenyList
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)