pub struct UdpManager { /* private fields */ }
Implementations§
Source§impl UdpManager
impl UdpManager
Sourcepub fn bind(addrs: impl ToSocketAddrs) -> Result<Self>
pub fn bind(addrs: impl ToSocketAddrs) -> Result<Self>
Binds a UdpSocket and starts listening on it.
§Errors
Returns a std::io::Error if it fails to bind to the provided socket addresses or start an async poll on the socket.
Sourcepub fn connect(&self, config: UdpConnectionConfig) -> Peer
pub fn connect(&self, config: UdpConnectionConfig) -> Peer
Creates a Peer bound to a specific target SocketAddr.
Note this does not block or send any I/O. It simply creates the tasks for reading and sending.
Sourcepub fn disconnect(&self, addr: SocketAddr)
pub fn disconnect(&self, addr: SocketAddr)
Disconnects the connection to a given SocketAddr if available.
Auto Trait Implementations§
impl Freeze for UdpManager
impl !RefUnwindSafe for UdpManager
impl Send for UdpManager
impl Sync for UdpManager
impl Unpin for UdpManager
impl !UnwindSafe for UdpManager
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