pub struct AsciiDenyList { /* private fields */ }
Expand description
The ASCII deny list to be applied.
Implementations§
Source§impl AsciiDenyList
impl AsciiDenyList
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.
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.
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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more