pub struct UdpCtx<'a> { /* private fields */ }Expand description
What an Endpoint callback can do.
Implementations§
Source§impl UdpCtx<'_>
impl UdpCtx<'_>
Sourcepub fn send(&mut self, msgs: &[Transmit<'_>]) -> Result<usize>
pub fn send(&mut self, msgs: &[Transmit<'_>]) -> Result<usize>
Sends datagrams at once (batched, with GSO where the kernel has it). Returns how many
transmits were handed to the kernel; WouldBlock means none was (socket buffer full).
Sourcepub fn local_addr(&mut self) -> Option<SocketAddr>
pub fn local_addr(&mut self) -> Option<SocketAddr>
The bound address.
Sourcepub fn set_timer(&mut self, after: Duration, token: u64) -> TimerId
pub fn set_timer(&mut self, after: Duration, token: u64) -> TimerId
Calls Endpoint::on_timer with token after after.
Sourcepub fn cancel_timer(&mut self, id: TimerId) -> bool
pub fn cancel_timer(&mut self, id: TimerId) -> bool
Cancels a timer.
Sourcepub fn handle(&mut self) -> EndpointHandle
pub fn handle(&mut self) -> EndpointHandle
A handle for reaching this endpoint from other threads.
Sourcepub fn buffer(&mut self, min: usize) -> Vec<u8> ⓘ
pub fn buffer(&mut self, min: usize) -> Vec<u8> ⓘ
An empty pooled buffer with room for min bytes.
Sourcepub fn offload_pool(&mut self) -> &OffloadPool
pub fn offload_pool(&mut self) -> &OffloadPool
The offload pool.
Sourcepub fn loop_index(&mut self) -> usize
pub fn loop_index(&mut self) -> usize
The loop index.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for UdpCtx<'a>
impl<'a> !Send for UdpCtx<'a>
impl<'a> !Sync for UdpCtx<'a>
impl<'a> !UnwindSafe for UdpCtx<'a>
impl<'a> Forget for UdpCtx<'a>
impl<'a> Freeze for UdpCtx<'a>
impl<'a> Move for UdpCtx<'a>
impl<'a> Unpin for UdpCtx<'a>
impl<'a> UnsafeUnpin for UdpCtx<'a>
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