Available on crate feature
managed
only.Expand description
Managed connection module. Handles reconnection and name uniqueness. Wraps a normal query connection with health checks. Handles renaming and claimed names. Useful if running long-lasting connections which tend to break over the wire.
use ts3_query::*;
let cfg = managed::ManagedConfig::new("127.0.0.1:10011",9987,"serveradmin".into(),"asdf".into())?
.name("my bot".to_string());
let mut conn = managed::ManagedConnection::new(cfg)?;
// get inner connection with check for being alive
// then perform a command on it
let _ = conn.get()?.whoami(false)?;
Structs§
- Managed
Config - Config for creating a managed connection
- Managed
Connection - QueryClient wrapper with connection-check on access
Constants§
- DEFAULT_
TIMEOUT_ CMD - Default timeout for sending/receiving
- DEFAULT_
TIMEOUT_ CONN - Default connection timeout
- MAX_
LEN_ NAME - Max name length to allow unique names