Crates.io | dns-server |
lib.rs | dns-server |
version | 0.2.4 |
source | src |
created_at | 2022-04-26 06:27:25.361923 |
updated_at | 2024-09-30 06:43:28.206586 |
description | A threaded DNS server. |
homepage | |
repository | https://gitlab.com/leonhard-llc/ops |
max_upload_size | |
id | 575145 |
size | 80,743 |
A threaded DNS server library.
std
forbid(unsafe_code)
use dns_server::DnsRecord;
use permit::Permit;
use signal_hook::consts::{SIGHUP, SIGINT, SIGQUIT, SIGTERM};
use signal_hook::iterator::Signals;
let top_permit = Permit::new();
let permit = top_permit.new_sub();
std::thread::spawn(move || {
Signals::new([SIGHUP, SIGINT, SIGQUIT, SIGTERM])
.unwrap()
.forever()
.next();
drop(top_permit);
});
let records = vec![
DnsRecord::new_a("aaa.example.com", "10.0.0.1").unwrap(),
DnsRecord::new_aaaa("aaa.example.com", "2606:2800:220:1:248:1893:25c8:1946").unwrap(),
DnsRecord::new_cname("bbb.example.com", "ccc.example.com").unwrap(),
];
dns_server::Builder::new_port(8053)
.unwrap()
.with_permit(permit)
.serve_static(&records)
.unwrap();
Metric output format: x/y
x = unsafe code used by the build
y = total unsafe code found in the crate
Symbols:
🔒 = No `unsafe` usage found, declares #![forbid(unsafe_code)]
❓ = No `unsafe` usage found, missing #![forbid(unsafe_code)]
☢️ = `unsafe` usage found
Functions Expressions Impls Traits Methods Dependency
0/0 0/0 0/0 0/0 0/0 🔒 dns-server 0.2.4
0/0 0/0 0/0 0/0 0/0 🔒 ├── prob-rate-limiter 0.1.1
0/0 0/0 0/0 0/0 0/0 🔒 │ └── oorandom 11.1.3
0/0 0/0 0/0 0/0 0/0 🔒 ├── fixed-buffer 0.3.1
0/0 0/0 0/0 0/0 0/0 🔒 ├── oorandom 11.1.3
0/0 0/0 0/0 0/0 0/0 🔒 └── permit 0.2.1
0/0 0/0 0/0 0/0 0/0
permit
v0.2OsStr
, for using environment variablesLicense: Apache-2.0