pub struct MinetestConnection { /* private fields */ }
Expand description
This is owned by the driver
Implementations§
Source§impl MinetestConnection
impl MinetestConnection
pub fn new(peer: Peer) -> Self
pub fn remote_addr(&self) -> SocketAddr
Sourcepub async fn send(&self, command: ToClientCommand) -> Result<()>
pub async fn send(&self, command: ToClientCommand) -> Result<()>
Send a command to the client
pub async fn send_access_denied(&self, code: AccessDeniedCode) -> Result<()>
Sourcepub async fn recv(&mut self) -> Result<ToServerCommand>
pub async fn recv(&mut self) -> Result<ToServerCommand>
Await a command from the peer Returns (channel, reliable flag, Command) Returns None when the peer is disconnected
Auto Trait Implementations§
impl Freeze for MinetestConnection
impl RefUnwindSafe for MinetestConnection
impl Send for MinetestConnection
impl Sync for MinetestConnection
impl Unpin for MinetestConnection
impl UnwindSafe for MinetestConnection
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