Struct idna::uts46::AsciiDenyList

source ·
#[repr(transparent)]
pub struct AsciiDenyList { bits: u128, }
Expand description

The ASCII deny list to be applied.

Fields§

§bits: u128

Implementations§

source§

impl AsciiDenyList

source

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.

source

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.

source

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.

source

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

source§

fn clone(&self) -> AsciiDenyList

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl PartialEq for AsciiDenyList

source§

fn eq(&self, other: &AsciiDenyList) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Copy for AsciiDenyList

source§

impl Eq for AsciiDenyList

source§

impl StructuralPartialEq for AsciiDenyList

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> ErasedDestructor for T
where T: 'static,

source§

impl<T> MaybeSendSync for T