Struct minetest_protocol::services::conn::MinetestConnection
source · 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