Expand description
This crate provides a high-level cross-platform implementation of an RCON client for Northstar mod, as it’s implemented in the RCON PR.
The client is entirely asynchronous and requires a Tokio runtime.
To connect to an RCON server and create a client instance, use the connect
function.
§Example
use northstar_rcon_client::connect;
#[tokio::main]
async fn main() {
let client = connect("localhost:37015")
.await
.unwrap();
let (mut read, mut write) = client.authenticate("password123")
.await
.unwrap();
write.enable_console_logs().await.unwrap();
write.exec_command("status").await.unwrap();
loop {
let line = read.receive_console_log().await.unwrap();
println!("> {}", line);
}
}
Structs§
- Client
Read - The read end of a connected and authenticated RCON client.
- Client
Write - The write end of a connected and authenticated RCON client.
- NotAuthenticated
Client - A connected but not yet authenticated RCON client.
Enums§
- Auth
Error - An error describing why an authentication request failed.
- Error
- Error type for RCON operations.
Functions§
- connect
- Asynchronously connect to an RCON server.