Skip to main content

UdpCtx

Struct UdpCtx 

Source
pub struct UdpCtx<'a> { /* private fields */ }
Expand description

What an Endpoint callback can do.

Implementations§

Source§

impl UdpCtx<'_>

Source

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).

Source

pub fn local_addr(&mut self) -> Option<SocketAddr>

The bound address.

Source

pub fn set_timer(&mut self, after: Duration, token: u64) -> TimerId

Calls Endpoint::on_timer with token after after.

Source

pub fn cancel_timer(&mut self, id: TimerId) -> bool

Cancels a timer.

Source

pub fn handle(&mut self) -> EndpointHandle

A handle for reaching this endpoint from other threads.

Source

pub fn buffer(&mut self, min: usize) -> Vec<u8> ⓘ

An empty pooled buffer with room for min bytes.

Source

pub fn recycle(&mut self, buf: Vec<u8>)

Returns a buffer to the pool.

Source

pub fn offload_pool(&mut self) -> &OffloadPool

The offload pool.

Source

pub fn now_ns(&mut self) -> u64

The loop’s clock in nanoseconds.

Source

pub fn loop_index(&mut self) -> usize

The loop index.

Trait Implementations§

Source§

impl Debug for UdpCtx<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.