pub struct ManagedConnection { /* private fields */ }
Available on crate feature
managed
only.Expand description
QueryClient wrapper with connection-check on access
Implementations§
Source§impl ManagedConnection
impl ManagedConnection
Sourcepub fn conn_id(&mut self) -> Result<ClientId, Ts3Error>
pub fn conn_id(&mut self) -> Result<ClientId, Ts3Error>
Returns the current connection id (clid)
Sourcepub fn clone(&self, new_name: Option<String>) -> Result<Self, Ts3Error>
pub fn clone(&self, new_name: Option<String>) -> Result<Self, Ts3Error>
Try creating a second connection, based on the configs of this one.
new_name
can specifiy a different connection client name.
Sourcepub fn new(config: ManagedConfig) -> Result<ManagedConnection, Ts3Error>
pub fn new(config: ManagedConfig) -> Result<ManagedConnection, Ts3Error>
Create new TS-Connection with an optional name
Sourcepub fn force_reconnect(&mut self) -> Result<(), Ts3Error>
pub fn force_reconnect(&mut self) -> Result<(), Ts3Error>
Force reconnect, may be called if server returns invalid data on call. Can happen if for example the firewall just drops packages for some time.
Sourcepub fn get(&mut self) -> Result<&mut QueryClient, Ts3Error>
pub fn get(&mut self) -> Result<&mut QueryClient, Ts3Error>
Returns the active connection or fallbacks to reconnect Checks for connection health every 1 second between a get() call.
Auto Trait Implementations§
impl Freeze for ManagedConnection
impl RefUnwindSafe for ManagedConnection
impl Send for ManagedConnection
impl Sync for ManagedConnection
impl Unpin for ManagedConnection
impl UnwindSafe for ManagedConnection
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