1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Networking abstractions built on Veilid API primitives.
//!
//! veilnet provides high-level networking capabilities using the Veilid distributed hash table
//! and private routing system. It enables applications to communicate over the Veilid network
//! without dealing directly with low-level Veilid APIs.
//!
//! # Examples
//!
//! Creating a connection and setting up datagram communication:
//!
//! ```no_run
//! use veilnet::{
//! connection::Veilid,
//! datagram::{Listener, Dialer}
//! };
//!
//! # async fn example() -> Result<(), Box<dyn std::error::Error>> {
//! let conn = Veilid::new().await?;
//! let listener = Listener::new(conn, None, 8080).await?;
//! let addr = listener.addr().clone();
//!
//! let conn2 = Veilid::new().await?;
//! let mut dialer = Dialer::new(conn2).await?;
//! let (route_id, _) = dialer.resolve(&addr).await?;
//! dialer.send_to(route_id, b"Hello, world!".to_vec()).await?;
//! # Ok(())
//! # }
//! ```
/// Connection management and Veilid network interface.
/// Datagram-style communication over Veilid private routes.
/// A connection to the Veilid network.
pub use Connection;
/// An address for DHT-based communication in the Veilid network.
pub use DHTAddr;