Crates.io | rercon |
lib.rs | rercon |
version | 1.2.0 |
source | src |
created_at | 2019-08-13 14:32:55.570865 |
updated_at | 2021-08-24 08:39:36.086934 |
description | A simple RCON library with automatic reconnection support |
homepage | |
repository | https://github.com/ikkerens/rercon |
max_upload_size | |
id | 156446 |
size | 26,857 |
ReRCON is a RCON library written with primarily the game Ark: Survival Evolved in mind. While this library is Valve RCON compliant, and should thus work with other RCON applications, it has not been tested for other applications.
There are two primary types to be used with this create,
Connection
and ReConnection
,
both of these types share the same API,
the primary difference is that ReConnection::exec
will never return IO errors
,
as it will start a new thread to reconnect,
instead, it will return error BusyReconnecting
,
with a string being a to_string
representation of the error that caused the reconnect in the first place.
All public methods use a template to accept all forms of strings that implement Into<String>
, however the library will always return std::string::String
Starting with v2, this library will be fully async. The non-async version will no longer be supported.
use rercon::Connection;
let mut connection = Connection::open("123.456.789.123:27020", "my_secret_password", None).await?;
let reply = connection.exec("hello").await?;
println!("Reply from server: {}", reply);
use rercon::ReConnection;
let mut connection = ReConnection::open("123.456.789.123:27020", "my_secret_password", None).await?;
let reply = connection.exec("hello").await?;
println!("Reply from server: {}", reply);