pub struct UdpControl { /* private fields */ }Expand description
Endpoint-wide UDP lifecycle authority.
This capability is cloneable. Every clone controls the same socket, and shutdown is irreversible and idempotent. It affects all clients and handles that share the endpoint, including clients for other targets.
Implementations§
Source§impl UdpControl
impl UdpControl
Sourcepub fn stats(&self) -> UdpStats
pub fn stats(&self) -> UdpStats
Snapshot cumulative endpoint statistics.
Statistics remain readable after shutdown.
Sourcepub fn is_shutdown(&self) -> bool
pub fn is_shutdown(&self) -> bool
Return whether endpoint shutdown has been requested.
Sourcepub async fn shutdown(&self)
pub async fn shutdown(&self)
Irreversibly shut down the entire UDP endpoint.
Pending operations on every client are woken. When this method returns,
no operation that began before cancellation remains active, and future
sends, requests, and receives fail with Error::Closed before request
registration or socket I/O. Concurrent and repeated calls are safe.
Trait Implementations§
Source§impl Clone for UdpControl
impl Clone for UdpControl
Source§fn clone(&self) -> UdpControl
fn clone(&self) -> UdpControl
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for UdpControl
impl !UnwindSafe for UdpControl
impl Freeze for UdpControl
impl Send for UdpControl
impl Sync for UdpControl
impl Unpin for UdpControl
impl UnsafeUnpin for UdpControl
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