pub struct MinetestSocket { /* private fields */ }
Expand description
MinetestSocket
Handles the raw UDP socket, protocol validation, separating packets by peer, reliable packet send, and split packets.
The actual contents of the communication, including authentication/handshaking, are not handled at this layer.
Implementations§
Source§impl MinetestSocket
impl MinetestSocket
Sourcepub async fn new(bind_addr: SocketAddr, for_server: bool) -> Result<Self, Error>
pub async fn new(bind_addr: SocketAddr, for_server: bool) -> Result<Self, Error>
Create a new MinetestSocket and bind to address. The address may be V4 or V6. To select a random bind port, use 0.0.0.0:0 or [::]:0
pub async fn add_peer(&mut self, remote: SocketAddr) -> Peer
Auto Trait Implementations§
impl Freeze for MinetestSocket
impl RefUnwindSafe for MinetestSocket
impl Send for MinetestSocket
impl Sync for MinetestSocket
impl Unpin for MinetestSocket
impl UnwindSafe for MinetestSocket
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