pub struct Idna {}
Expand description
IDNA struct implements the to_ascii
and to_unicode
functions from the Unicode Technical
Standard supporting a wide range of systems. It is suitable for URL parsing.
For more information, read the specification
Implementations§
source§impl Idna
impl Idna
sourcepub fn unicode(input: &str) -> &str
pub fn unicode(input: &str) -> &str
Process international domains according to the UTS #46 standard. Returns empty string if the input is invalid.
For more information, read the specification
use ada_url::Idna;
assert_eq!(Idna::unicode("xn--meagefactory-m9a.ca"), "meßagefactory.ca");
sourcepub fn ascii(input: &str) -> &str
pub fn ascii(input: &str) -> &str
Process international domains according to the UTS #46 standard. Returns empty string if the input is invalid.
For more information, read the specification
use ada_url::Idna;
assert_eq!(Idna::ascii("meßagefactory.ca"), "xn--meagefactory-m9a.ca");
Auto Trait Implementations§
impl Freeze for Idna
impl RefUnwindSafe for Idna
impl Send for Idna
impl Sync for Idna
impl Unpin for Idna
impl UnwindSafe for Idna
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
Mutably borrows from an owned value. Read more