Trait StringCheck

Source
pub trait StringCheck {
    // Required methods
    fn is_whitespace_or_empty(&self) -> bool;
    fn is_ldh_string(&self) -> bool;
    fn is_ldh_domain_name(&self) -> bool;
    fn is_unicode_domain_name(&self) -> bool;
    fn is_tld(&self) -> bool;
}

Required Methods§

Source

fn is_whitespace_or_empty(&self) -> bool

Tests if the string is empty, including for if the string only has whitespace.

Source

fn is_ldh_string(&self) -> bool

Tests if the string contains only letters, digits, or hyphens and is not empty.

Source

fn is_ldh_domain_name(&self) -> bool

Tests if a string is an LDH doamin name. This is not to be confused with StringCheck::is_ldh_string, which checks individual domain labels.

Source

fn is_unicode_domain_name(&self) -> bool

Tests if a string is a Unicode domain name.

Source

fn is_tld(&self) -> bool

Tests if a string is begins with a period and only has one label.

Implementors§