Expand description
§Pkarr
Rust implementation of Pkarr for publishing and resolving DNS packets over Mainline DHT.
§Documentation
§Features
§Runtime Support
- Asynchronous by Default: Built on async/await for optimal performance
- Blocking API Available: Use
Client::as_blocking()
for synchronous operations - Runtime Agnostic: Compatible with non-Tokio runtimes via
async_compat
§WebAssembly
- Browser Environment: Designed for JavaScript/Wasm integration
- Relay Communication: Uses browser’s Fetch API for relay calls
- Limitations:
- Not compatible with WASI
- Cannot use WASI bindings for direct DHT access
§Feature flags
-
dht
(enabled by default) — Enable the Client with mainline support. -
lmdb-cache
— Use LmdbCache implementation. Only available if theclient
module is enabled. -
endpoints
— Enables endpoints spec.Only available if the
client
module is enabled. -
tls
— Enables tls spec.Only available if the
client
module is enabled. -
reqwest-resolve
— Use reqwest::dns::Resolve trait implementation for Client.Only available if the
client
module is enabled. -
reqwest-builder
— Create a reqwest::ClientBuilder from Client.Only available if the
client
module is enabled. -
full-client
(enabled by default) — Use all features -
extra
— Extra features that might benefit most but not all developers building apps using Pkarr.Only available if the
client
module is enabled. -
full
— Use all features including thefull-client
andextra
features. -
__client
(enabled by default) — Enable client dependencies.Does not enable anything on its own you need to enable either
dht
and/orrelays
to enable the Client.Except in WASM where you have to enable
relays
, whiledht
does not do anything.
Re-exports§
pub use mainline;
pub use simple_dns as dns;
Modules§
- errors
- Exported errors
- extra
- Extra features that might benefit most but not all developers building apps using Pkarr.
Structs§
- Client
- Pkarr client for publishing and resolving SignedPackets over mainline Dht and/or Relays.
- Client
Blocking - A blocking (synchronous) version of Client.
- Client
Builder - A builder for constructing a
Client
with custom configuration. - InMemory
Cache - A thread safe wrapper around lru::LruCache
- Keypair
- Ed25519 keypair to sign dns Packets.
- Public
Key - Ed25519 public key to verify a signature over dns Packets.
- Signed
Packet - Signed DNS packet
- Signed
Packet Builder - A builder for SignedPacket with many convenient methods, see SignedPacket::builder documentation for examples of how to use this builder.
- Timestamp
- Strictly monotonic timestamp since SystemTime::UNIX_EPOCH in microseconds.
Constants§
- DEFAULT_
CACHE_ SIZE - Default cache size: 1000
- DEFAULT_
MAXIMUM_ TTL - Default maximum TTL: 24 hours.
- DEFAULT_
MINIMUM_ TTL - Default minimum TTL: 5 minutes.
- DEFAULT_
RELAYS - Default Relays.
Traits§
- Cache
- A trait for a SignedPackets cache for Pkarr Client.
Type Aliases§
- Cache
Key - The sha1 hash of the crate::PublicKey used as the key in Cache.