Crates.io | gtld-data |
lib.rs | gtld-data |
version | 0.4.1 |
source | src |
created_at | 2016-02-28 17:34:24.815038 |
updated_at | 2016-07-06 04:10:33.116208 |
description | gTLD data retrieved via the IANA, updated daily. |
homepage | https://github.com/taiyaeix/gtld-data.rs |
repository | https://github.com/taiyaeix/gtld-data.rs.git |
max_upload_size | |
id | 4324 |
size | 23,010 |
Rust crate for gTLD data with a few useful functions. The list of gTLDs is created/updated on build of the library.
All renames, additions, and removals of gTLD's are due to the IANA removing their entries.
All API changes are subject to Semver.
A Generic Top Level Domain (gTLD) is an internet domain name extension with three or more characters. It is one of the categories of the top level domain (TLD) in the Domain Name System (DNS) maintained by the Internet Assigned Numbers Authority.
-- icannwiki
Add the following dependency to your Cargo.toml:
gtld-data = "^0.4"
And include it in your project:
extern crate gtld_data;
Retrieve a Vec
of all Gtld
definitions:
let gtlds = gtld_data::all();
Check if a domain for a Gtld
exists:
use gtld_data::domain_exists;
let exists = domain_exists("com");
Retrieve a Vec
of Gtld
s based on a given GtldKind
:
use gtld_data::{GtldKind, get_by_kind};
let generics = get_by_kind(GtldKind::Generic);
assert!(generics.len() > 0);
Retrieve a Vec
of Gtld
s based on the name of the organization passed:
use gtld_data::get_by_organization;
let organization = "VeriSign Global Registry Services";
let gtlds = get_by_organization(organization);
assert!(gtlds.len() > 0);
License info in LICENSE.md. Long story short, ISC.