pub struct ManagedConfig { /* private fields */ }
Available on crate feature
managed
only.Expand description
Config for creating a managed connection
use std::time::Duration;
let cfg = ManagedConfig::new("127.0.0.1:10011",9987,"serveradmin".into(),"asdf".into())?
.name("my test bot".to_string())
.connection_timeout(Duration::from_secs(1))
.timeout(Duration::from_secs(1));
Implementations§
Source§impl ManagedConfig
impl ManagedConfig
Sourcepub fn new<A: ToSocketAddrs>(
addr: A,
server_port: u16,
user: String,
password: String,
) -> Result<Self, Ts3Error>
pub fn new<A: ToSocketAddrs>( addr: A, server_port: u16, user: String, password: String, ) -> Result<Self, Ts3Error>
Create a new ManagedConfig with default values
Sourcepub fn name(self, name: String) -> Self
pub fn name(self, name: String) -> Self
Set name of client for connection
All names have to be shorter than MAX_LEN_NAME.
This is required as you always have to leave enough space for teamspeak
to allow appending a unique number. Otherwise connections will fail
if the name is already claimed and too long to be made unique.
This is a limitation of the teamspeak API.
Sourcepub fn connection_timeout(self, timeout: Duration) -> Self
pub fn connection_timeout(self, timeout: Duration) -> Self
Set connection timeout
Trait Implementations§
Source§impl Clone for ManagedConfig
impl Clone for ManagedConfig
Source§fn clone(&self) -> ManagedConfig
fn clone(&self) -> ManagedConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ManagedConfig
impl RefUnwindSafe for ManagedConfig
impl Send for ManagedConfig
impl Sync for ManagedConfig
impl Unpin for ManagedConfig
impl UnwindSafe for ManagedConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more