Data Transfer Protocol for Rust
Cross-platform networking interfaces for Rust.
Data Transfer Protocol
The Data Transfer Protocol (DTP) is a larger project to make ergonomic network programming available in any language. See the full project here.
Installation
Add the package in Cargo.toml
:
= { = "*", = ["rt-tokio"] }
Selecting a runtime
The protocol can be used with both the tokio
and async-std
runtimes, as well as in purely synchronous environments. Each implementation is gated behind a feature:
rt-tokio
: the tokio implementation, available asrustdtp::rt_tokio
rt-async-std
: the async-std implementation, available asrustdtp::rt_async_std
rt-sync
: the synchronous implementation, available asrustdtp::rt_sync
Multiple features can be activated at the same time, though most times this is not useful.
Creating a server
A server can be built using the Server
implementation:
use *;
async
Creating a client
A client can be built using the Client
implementation:
use *;
async
Security
Information security comes included. Every message sent over a network interface is encrypted with AES-256. Key exchanges are performed using a 2048-bit RSA key-pair.