pub struct ReConnection { /* private fields */ }
Expand description
Drop-in replacement wrapper of Connection
which intercepts all IO errors
returned by Connection::exec
to start the reconnection thread, and will opt to return BusyReconnecting
instead.
For further docs, refer to Connection
, as it shares the same API.
Implementations§
Source§impl ReconnectingConnection
impl ReconnectingConnection
Sourcepub async fn open(
address: impl ToString,
pass: impl ToString,
settings: Settings,
) -> Result<Self, RconError>
pub async fn open( address: impl ToString, pass: impl ToString, settings: Settings, ) -> Result<Self, RconError>
This function behaves identical to Connection::open
.
Sourcepub async fn exec(&mut self, cmd: impl ToString) -> Result<String, RconError>
pub async fn exec(&mut self, cmd: impl ToString) -> Result<String, RconError>
This function behaves identical to Connection::exec
unless Err([IO](enum.Error.html#variant.IO))
is returned,
in which case it will start reconnecting and return BusyReconnecting
until the connection has been re-established.
Auto Trait Implementations§
impl Freeze for ReconnectingConnection
impl !RefUnwindSafe for ReconnectingConnection
impl Send for ReconnectingConnection
impl Sync for ReconnectingConnection
impl Unpin for ReconnectingConnection
impl !UnwindSafe for ReconnectingConnection
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