Skip to main content

Crate veilnet

Crate veilnet 

Source
Expand description

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:

use veilnet::{
    connection::Veilid,
    datagram::{Listener, Dialer}
};

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?;

Re-exports§

pub use connection::Connection;

Modules§

connection
Connection management and Veilid network interface.
datagram
Datagram-style communication over Veilid private routes. Datagram-style communication over Veilid private routes.
proto

Structs§

DHTAddr
An address for DHT-based communication in the Veilid network. An address for DHT-based communication in the Veilid network.