Struct recvmsg::Empty

source ·
pub struct Empty<AddrBuf = ()>(/* private fields */);
Expand description

Dummy message stream that is at end-of-stream from the outset.

Implementations§

source§

impl<AddrBuf> Empty<AddrBuf>

source

pub fn new() -> Self

Creates a dummy message stream.

Trait Implementations§

source§

impl<AddrBuf: Clone> Clone for Empty<AddrBuf>

source§

fn clone(&self) -> Empty<AddrBuf>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<AddrBuf: Debug> Debug for Empty<AddrBuf>

source§

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

Formats the value using the given formatter. Read more
source§

impl<AddrBuf> Default for Empty<AddrBuf>

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl<AddrBuf: Hash> Hash for Empty<AddrBuf>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<AddrBuf: Ord> Ord for Empty<AddrBuf>

source§

fn cmp(&self, other: &Empty<AddrBuf>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<AddrBuf: PartialEq> PartialEq for Empty<AddrBuf>

source§

fn eq(&self, other: &Empty<AddrBuf>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<AddrBuf: PartialOrd> PartialOrd for Empty<AddrBuf>

source§

fn partial_cmp(&self, other: &Empty<AddrBuf>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<AddrBuf> RecvMsg for Empty<AddrBuf>

§

type Error = Infallible

The I/O error type. Read more
§

type AddrBuf = AddrBuf

The buffer used for sender address reception. Read more
source§

fn poll_recv_msg( self: Pin<&mut Self>, _: &mut Context<'_>, _: &mut MsgBuf<'_>, _: Option<&mut AddrBuf> ) -> Poll<Result<RecvResult, Self::Error>>

Polls a future that receives one message using the given buffer, (re)allocating the buffer if necessary. Read more
source§

impl<AddrBuf> RecvMsg for Empty<AddrBuf>

§

type Error = Infallible

The I/O error type. Read more
§

type AddrBuf = AddrBuf

The buffer used for sender address reception. Read more
source§

fn recv_msg( &mut self, _: &mut MsgBuf<'_>, _: Option<&mut AddrBuf> ) -> Result<RecvResult, Self::Error>

Receives one message using the given buffer, (re)allocating the buffer if necessary. Read more
source§

impl<AddrBuf> TruncatingRecvMsg for Empty<AddrBuf>

§

type Error = Infallible

The I/O error type. Read more
§

type AddrBuf = AddrBuf

The buffer used for sender address reception. Read more
source§

fn recv_trunc( &mut self, _: bool, _: &mut MsgBuf<'_>, _: Option<&mut AddrBuf> ) -> Result<Option<bool>, Self::Error>

Receives one message into the given buffer, returning: Read more
source§

fn discard_msg(&mut self) -> Result<(), Self::Error>

Discards the message at the front of the queue. If at end-of-communication, succeeds with no effect.
source§

impl<AddrBuf> TruncatingRecvMsg for Empty<AddrBuf>

§

type Error = Infallible

The I/O error type. Read more
§

type AddrBuf = AddrBuf

The buffer used for sender address reception. Read more
source§

fn poll_recv_trunc( self: Pin<&mut Self>, _: &mut Context<'_>, _: bool, _: &mut MsgBuf<'_>, _: Option<&mut AddrBuf> ) -> Poll<Result<Option<bool>, Self::Error>>

Polls a future that receives one message into the given buffer, returning within Poll::Ready: Read more
source§

fn poll_discard_msg( self: Pin<&mut Self>, cx: &mut Context<'_> ) -> Poll<Result<(), Self::Error>>

Polls a future that discards the message at the front of the queue. If at end-of-communication, succeeds with no effect. Read more
source§

impl<AddrBuf> TruncatingRecvMsgWithFullSize for Empty<AddrBuf>

source§

fn recv_trunc_with_full_size( &mut self, _: bool, _: &mut MsgBuf<'_>, _: Option<&mut AddrBuf> ) -> Result<TryRecvResult, Self::Error>

Like .recv_trunc(), but returns the true length of the message (size before truncation).
source§

impl<AddrBuf> TruncatingRecvMsgWithFullSize for Empty<AddrBuf>

source§

fn poll_recv_trunc_with_full_size( self: Pin<&mut Self>, _: &mut Context<'_>, _: bool, _: &mut MsgBuf<'_>, _: Option<&mut AddrBuf> ) -> Poll<Result<TryRecvResult, Self::Error>>

Like .poll_recv_trunc(), but returns the true length of the message (size before truncation).
source§

impl<AddrBuf: Copy> Copy for Empty<AddrBuf>

source§

impl<AddrBuf: Eq> Eq for Empty<AddrBuf>

source§

impl<AddrBuf> StructuralEq for Empty<AddrBuf>

source§

impl<AddrBuf> StructuralPartialEq for Empty<AddrBuf>

Auto Trait Implementations§

§

impl<AddrBuf> RefUnwindSafe for Empty<AddrBuf>

§

impl<AddrBuf> Send for Empty<AddrBuf>

§

impl<AddrBuf> Sync for Empty<AddrBuf>

§

impl<AddrBuf> Unpin for Empty<AddrBuf>

§

impl<AddrBuf> UnwindSafe for Empty<AddrBuf>

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> RecvMsgExt for T
where T: RecvMsg + ?Sized,

source§

fn recv_msg<'io, 'buf, 'slice: 'buf, 'abuf>( &'io mut self, buf: &'buf mut MsgBuf<'slice>, abuf: Option<&'abuf mut Self::AddrBuf> ) -> Recv<'io, 'buf, 'slice, 'abuf, Self>
where Self: Unpin,

Receives one message using the given buffer, (re)allocating the buffer if necessary. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> TruncatingRecvMsgExt for T

source§

fn recv_trunc<'io, 'buf, 'slice, 'abuf>( &'io mut self, peek: bool, buf: &'buf mut MsgBuf<'slice>, abuf: Option<&'abuf mut Self::AddrBuf> ) -> RecvTrunc<'io, 'buf, 'slice, 'abuf, Self>
where Self: Unpin,

Receives one message into the given buffer, returning: Read more
source§

fn discard_msg(&mut self) -> DiscardMsg<'_, Self>
where Self: Unpin,

Discards the message at the front of the queue. If at end-of-communication, succeeds with no effect.
source§

impl<T> TruncatingRecvMsgWithFullSizeExt for T

source§

fn try_recv_msg( &mut self, buf: &mut MsgBuf<'_>, abuf: Option<&mut Self::AddrBuf> ) -> Result<TryRecvResult, Self::Error>

Attempts to receive one message using the given buffer. If the message at the front of the queue does not fit, no (re)allocation is done and the message is neither written to the buffer nor taken off the underlying queue. Read more
source§

impl<T> TruncatingRecvMsgWithFullSizeExt for T

source§

fn recv_trunc_with_full_size<'io, 'buf, 'slice, 'abuf>( &'io mut self, peek: bool, buf: &'buf mut MsgBuf<'slice>, abuf: Option<&'abuf mut Self::AddrBuf> ) -> RecvTruncWithFullSize<'io, 'buf, 'slice, 'abuf, Self>
where Self: Unpin,

Like .recv_trunc(), but returns the true length of the message (size before truncation).
source§

fn try_recv_msg<'io, 'buf, 'slice, 'abuf>( &'io mut self, buf: &'buf mut MsgBuf<'slice>, abuf: Option<&'abuf mut Self::AddrBuf> ) -> TryRecv<'io, 'buf, 'slice, 'abuf, Self>

Attempts to receive one message using the given buffer. If the message at the front of the queue does not fit, no (re)allocation is done and the message is neither written to the buffer nor taken off the underlying queue. Read more
source§

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

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.