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

The read end of a connected and authenticated RCON client.

The write end of a connected and authenticated RCON client.

A connected but not yet authenticated RCON client.

Enums

An error describing why an authentication request failed.

Error type for RCON operations.

Functions

Asynchronously connect to an RCON server.

Type Definitions

Result alias for Error.