pub struct LuantiSocket { /* private fields */ }Expand description
LuantiSocket
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 LuantiSocket
impl LuantiSocket
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 LuantiSocket 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_server(&mut self, server_address: SocketAddr) -> Peer
Auto Trait Implementations§
impl Freeze for LuantiSocket
impl RefUnwindSafe for LuantiSocket
impl Send for LuantiSocket
impl Sync for LuantiSocket
impl Unpin for LuantiSocket
impl UnwindSafe for LuantiSocket
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