pub struct Socket { /* private fields */ }Expand description
A UDP socket driven by a crate::Worker.
Created by crate::Handle::udp. Dropping it cancels the armed receive
and releases the socket once the kernel confirms.
Implementations§
Source§impl Socket
impl Socket
Sourcepub fn local_addr(&self) -> Result<SocketAddr>
pub fn local_addr(&self) -> Result<SocketAddr>
The bound local address.
Sourcepub fn poll_recv(&self, waiter: &Waiter) -> Poll<Result<Packet>>
pub fn poll_recv(&self, waiter: &Waiter) -> Poll<Result<Packet>>
A received packet, or the socket’s terminal error, registering waiter
while neither is available. Queued packets drain before an error
surfaces.
Sourcepub fn poll_acquire(&self, waiter: &Waiter) -> Poll<Result<TxBuf>>
pub fn poll_acquire(&self, waiter: &Waiter) -> Poll<Result<TxBuf>>
A free send-staging buffer, registering waiter while the pool is
drained. Backpressure lives here: the pool caps in-flight sends.
Sourcepub async fn acquire(&self) -> Result<TxBuf>
pub async fn acquire(&self) -> Result<TxBuf>
Await poll_acquire.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Socket
impl !Send for Socket
impl !Sync for Socket
impl !UnwindSafe for Socket
impl Freeze for Socket
impl Unpin for Socket
impl UnsafeUnpin for Socket
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