pub trait EffectiveTLDProvider {
    // Required method
    fn effective_tld_plus_one<'a>(
        &self,
        domain: &'a str
    ) -> Result<&'a str, Error>;
}
Expand description

The EffectiveTLDProvider trait allows other crates in passkey-rs to use a custom domain TLD provider instead of using the DEFAULT_PROVIDER from this crate.

Required Methods§

source

fn effective_tld_plus_one<'a>(&self, domain: &'a str) -> Result<&'a str, Error>

Returns the effective top level domain plus one more label. For example, the eTLD+1 for “foo.bar.golang.org” is “golang.org”.

Note: The input string must be punycode (ASCII) and the result will be punycode (ASCII). The implementation of this function assumes each character is encoded in one byte; this assumption is inherent in the design of the generated table.

It is recommended to use idna::domain_to_ascii to convert your inputs to ASCII punycode before passing to this method.

Implementors§