1 unstable release

Uses old Rust 2015

0.1.0 May 1, 2017

#7 in #host-name

27 downloads per month

MIT license

21KB
372 lines

netdb: Network Database for Rust

This crate will eventually contain a pure-Rust implementation of queries for network-related names similar to the functions found in POSIX’ netdb.h. The eventual implementation will be cross-platform and perform the correct actions as configured for the particular system.

Usage

Add this to your Cargo.toml:

[dependencies]
netdb = "0.1.0"

Then, add this to your crate root:

extern crate netdb

Databases

The crate will contain the following databases, each available in a module of the same name:

  • hosts
  • networks
  • protocols
  • services

In addition, the following modules will provide functions combining information from several databases:

  • addr

lib.rs:

Querying the System’s Network Name Database

This crate allows querying the database of network-related names similar to the what can be found in POSIX’s netdb.h. The queries are performed in a way appropriate for the platform and consider the system’s configuration.

Note: This is not yet true for this initial release. It performs queries in a hard-wired fashion and probably only works correctly on Unix-y systems.

For each query, there are synchronous functions (generally prefixed with get_) as well as asynchronous functions return futures atop a Tokio reactor core (starting with poll_ for want of a better prefix).

For each database, there is a submodule. Have a look at these modules for more information.

Dependencies

~8MB
~133K SLoC