pub struct Connection<T> { /* private fields */ }
Implementations§
Source§impl Connection<TcpStream>
impl Connection<TcpStream>
Source§impl<T: AsyncRead + AsyncWrite + Unpin> Connection<T>
impl<T: AsyncRead + AsyncWrite + Unpin> Connection<T>
Sourcepub fn builder() -> Builder<T>
pub fn builder() -> Builder<T>
Create a connectiion builder. Allows configuring the rcon connection.
Sourcepub async fn handshake(io: T, password: &str) -> Result<Self>
Available on crate features rt-tokio
or rt-async-std
only.
pub async fn handshake(io: T, password: &str) -> Result<Self>
rt-tokio
or rt-async-std
only.Perform a handshake on an existing connection to an rcon server.
This is a lower-level method mostly useful when integrating this crate with another
runtime, or running rcon over a transport other than TCP. You generally will want to use
one of the higher-level connect
methods.
By default this enables Minecraft quirks.
If you need to customize this behaviour, use a Builder
.
This method requires one of the runtime features to be activated so that Minecraft quirks
mode is able to asynchronously sleep. If you want to provide a custom sleep function, see
Builder::sleep_fn
.
pub async fn cmd(&mut self, cmd: &str) -> Result<String>
Auto Trait Implementations§
impl<T> Freeze for Connection<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Connection<T>
impl<T> Send for Connection<T>where
T: Send,
impl<T> Sync for Connection<T>where
T: Sync,
impl<T> Unpin for Connection<T>where
T: Unpin,
impl<T> !UnwindSafe for Connection<T>
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