placeholder for network shim

This commit is contained in:
Christien Rioux 2024-10-25 17:19:53 -07:00
parent fd53ef5509
commit 0495afb3c6
2 changed files with 51 additions and 0 deletions

View File

@ -46,6 +46,7 @@ pub mod mutable_future;
#[cfg(not(target_arch = "wasm32"))] #[cfg(not(target_arch = "wasm32"))]
pub mod network_interfaces; pub mod network_interfaces;
pub mod network_result; pub mod network_result;
pub mod network_shim;
pub mod random; pub mod random;
pub mod single_shot_eventual; pub mod single_shot_eventual;
pub mod sleep; pub mod sleep;

View File

@ -0,0 +1,50 @@
//! # Network Shim
//!
//! ## Networking abstraction layer
//!
//! Support for mocking and virtualizing network connections, as well as passing through to supported
//! networking functionality.
//!
//! The following structs are available that allow connecting to a centralized virtual
//! router to emulate a large scale network.
//!
//! * RouterClient
//! * RouterServer
//!
//! Additional traits are is implemented for all shimmed APIs that have static methods
//! like `new()`, `default()`, `connect()` and `bind()` to allow optional namespacing
//! such that the structs they produce are new network router clients with their own
//! distinct IP addresses, network segments, and network characteristics as allocated
//! by the [RouterServer].
//!
//! A singleton RouterClient is created by this module that is used by default unless the
//! extension traits on the shimmed APIs are used to override it with another RouterClient instance.
//!
//! ## Available shims
//!
//! API-compatible shims for:
//! * Tokio (Native)
//! - [tokio::net::TcpListener]
//! - [tokio::net::TcpStream]
//! - [tokio::net::UdpSocket]
//! - [tokio_stream::wrappers::TcpListenerStream]
//! * Async-std (Native)
//! - [async_std::net::TcpListener]
//! - [async_std::net::TcpStream]
//! - [async_std::net::UdpSocket]
//! - [async_std::net::Incoming]
//! * std::net (Native)
//! - [std::net::TcpListener]
//! - [std::net::TcpStream]
//! - [std::net::UdpSocket]
//! - [std::net::Incoming]
//! * ws_stream_wasm (browser WASM)
//! - [ws_stream_wasm::WsMeta]
//! - [ws_stream_wasm::WsStream]
//! - [ws_stream_wasm::WsStreamIo]
//!
//! ## Other modules leveraging this module
//!
//! * `veilid-core`'s network `native` and `wasm` modules
//! * This crate's `network_interfaces` module
//! * This crate's `dns_lookup` module