Skip to main content

Incoming

Struct Incoming 

Source
pub struct Incoming { /* private fields */ }
Expand description

The receiving end of a UdpTransport.

It stops yielding datagrams once the transport is dropped.

Implementations§

Source§

impl Incoming

Source

pub fn recv(&self) -> Option<Datagram>

Waits for the next datagram. Returns None once the transport is closed.

Source

pub fn recv_timeout(&self, timeout: Duration) -> Option<Datagram>

Waits at most timeout for the next datagram.

Source

pub fn try_recv(&self) -> Option<Datagram>

Returns a datagram if one is waiting.

Source

pub fn handled(&self, user: usize)

Says that user datagrams of user traffic taken from here have been handled. With a UserHandler, user traffic goes to it only while none taken from here is still being handled, so that it is handled in the order it came.

Trait Implementations§

Source§

impl Debug for Incoming

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Sync for Incoming

§

impl Forget for Incoming

§

impl Freeze for Incoming
where *mut Counter<Channel<Datagram>>: Freeze, *mut Counter<Channel<Datagram>>: Freeze, *mut Counter<Channel<Datagram>>: Freeze, *const ArcInner<Atomic<usize>> is !null: Freeze, PhantomData<ArcInner<Atomic<usize>>>: Freeze,

§

impl Move for Incoming

§

impl RefUnwindSafe for Incoming

§

impl Send for Incoming

§

impl Unpin for Incoming
where *mut Counter<Channel<Datagram>>: Unpin, *mut Counter<Channel<Datagram>>: Unpin, *mut Counter<Channel<Datagram>>: Unpin, Arc<Atomic<usize>>: Unpin,

§

impl UnsafeUnpin for Incoming
where *mut Counter<Channel<Datagram>>: UnsafeUnpin, *mut Counter<Channel<Datagram>>: UnsafeUnpin, *mut Counter<Channel<Datagram>>: UnsafeUnpin, *const ArcInner<Atomic<usize>> is !null: UnsafeUnpin, PhantomData<ArcInner<Atomic<usize>>>: UnsafeUnpin,

§

impl UnwindSafe for Incoming

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.