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-core library supplies the client, manager, and server
implementations for use with the distant API in order to communicate with
remote machines and perform actions. This library acts as the primary
implementation that powers the CLI, but is also available for other extensions
like distant-ssh2.
Installation
You can import the dependency by adding the following to your Cargo.toml:
[]
= "0.17"
Features
Currently, the library supports the following features:
clap: generatesClapbindings forDistantRequestData(used by cli to expose request actions)schemars: derives theschemars::JsonSchemainterface onDistantMsg,DistantRequestData, andDistantResponseDatadata types
By default, no features are enabled on the library.
Examples
Below is an example of connecting to a distant server over TCP without any encryption or authentication:
use ;
use ;
// Connect to a server located at example.com on port 8080 that is using
// no encryption or authentication (PlainCodec)
let addr: SocketAddr = "example.com:8080".parse.unwrap;
let mut client = connect.await
.expect;
// Append text to a file
// NOTE: This method comes from DistantChannelExt
client.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.