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) -> String
pub fn unicode(input: &str) -> String
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) -> String
pub fn ascii(input: &str) -> String
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