Skip to main content

Rust SDK API Reference / TLD parsing / parse_supported_tld

Function: parse_supported_tld()

pub fn parse_supported_tld(domain: &str) -> Result<(&str, Tld), SnsError>

Defined in: tld.rs:54

Strips a suffix in SUPPORTED_TLDS and returns the borrowed bare name plus Tld. Current rollout configuration controls whether .sol is supported.

Parameters

domain: full read-side domain including a supported suffix.

Returns

The suffix-trimmed &str and Tld, or SnsError::UnsupportedTld.

Example

use sns_sdk::tld::parse_supported_tld;
let (name, tld) = parse_supported_tld("example.sns")?;