idna

Struct Config

source
pub struct Config {
    use_std3_ascii_rules: bool,
    transitional_processing: bool,
    verify_dns_length: bool,
    check_hyphens: bool,
}
๐Ÿ‘ŽDeprecated
Expand description

Deprecated configuration API.

Fieldsยง

ยงuse_std3_ascii_rules: bool
๐Ÿ‘ŽDeprecated
ยงtransitional_processing: bool
๐Ÿ‘ŽDeprecated
ยงverify_dns_length: bool
๐Ÿ‘ŽDeprecated
ยงcheck_hyphens: bool
๐Ÿ‘ŽDeprecated

Implementationsยง

sourceยง

impl Config

source

pub fn use_std3_ascii_rules(self, value: bool) -> Self

Whether to enforce STD3 or WHATWG URL Standard ASCII deny list.

true for STD3, false for no deny list.

Note that true rejects pseudo-hosts used by various TXT record-based protocols.

source

pub fn transitional_processing(self, value: bool) -> Self

Whether to enable (deprecated) transitional processing.

Note that Firefox, Safari, and Chrome do not use transitional processing.

source

pub fn verify_dns_length(self, value: bool) -> Self

Whether the VerifyDNSLength operation should be performed by to_ascii.

For compatibility with previous behavior, even when set to true, the trailing root label dot is allowed contrary to the spec.

source

pub fn check_hyphens(self, value: bool) -> Self

Whether to enforce STD3 rules for hyphen placement.

true to deny hyphens in the first and last positions. false to not enforce hyphen placement.

Note that for backward compatibility this is not the same as UTS 46 CheckHyphens, which also disallows hyphens in the third and fourth positions.

Note that true rejects real-world names, including some GitHub user pages.

source

pub fn use_idna_2008_rules(self, value: bool) -> Self

Obsolete method retained to ease migration. The argument must be false.

Panics

If the argument is true.

source

fn deny_list(&self) -> AsciiDenyList

Compute the deny list

source

fn hyphens(&self) -> Hyphens

Compute the hyphen mode

source

pub fn to_ascii(self, domain: &str) -> Result<String, Errors>

source

pub fn to_unicode(self, domain: &str) -> (String, Result<(), Errors>)

Trait Implementationsยง

sourceยง

impl Clone for Config

sourceยง

fn clone(&self) -> Config

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 Default for Config

The defaults are that of beStrict=false in the WHATWG URL Standard

sourceยง

fn default() -> Self

Returns the โ€œdefault valueโ€ for a type. Read more
sourceยง

impl Copy for Config

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> CloneToUninit for T
where T: Clone,

sourceยง

unsafe fn clone_to_uninit(&self, dst: *mut T)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. 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,

sourceยง

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>,

sourceยง

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>,

sourceยง

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