distant core
Library that powers the distant
binary.
🚧 (Alpha stage software) This library is in rapid development and may break or change frequently! 🚧
Details
The distant library supplies a mixture of functionality and data to run
servers that operate on remote machines and clients that talk to them.
- Asynchronous in nature, powered by
tokio - Data is serialized to send across the wire via
CBOR - Encryption & authentication are handled via XChaCha20Poly1305 for an authenticated encryption scheme via RustCrypto/ChaCha20Poly1305
Installation
You can import the dependency by adding the following to your Cargo.toml:
[]
= "0.15"
Features
Currently, the library supports the following features:
structopt: generatesStructOptbindings forRequestData(used by cli to expose request actions)
By default, no features are enabled on the library.
Examples
Below is an example of connecting to a distant server over TCP:
use ;
use SocketAddr;
// 32-byte secret key paresd from hex, used for a specific codec
let key: SecretKey32 = "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF".parse.unwrap;
let codec = from;
let addr: SocketAddr = "example.com:8080".parse.unwrap;
let mut session = tcp_connect.await.unwrap;
// Append text to a file, representing request as <tenant>
// NOTE: This method comes from SessionChannelExt
session.append_file_text.await.expect;
License
This project is licensed under either of
Apache License, Version 2.0, (LICENSE-APACHE or apache-license) MIT license (LICENSE-MIT or mit-license) at your option.