Skip to main content

MpscFdReceiver

Struct MpscFdReceiver 

Source
pub struct MpscFdReceiver<T> { /* private fields */ }
Expand description

Receiver half of an MpscFd pair

Implementations§

Source§

impl<T> MpscFdReceiver<T>

Source

pub fn recv(&mut self) -> Result<T, RecvError>

Receive a message from the mpsc channel and read a byte from the pipe.

Source

pub fn try_recv(&mut self) -> Result<T, TryRecvError>

Try to receive a message without blocking.

Readability of the fd is a hint that this will likely return a value, however this may return Empty and leave the fd readable in certain cases.

Source

pub fn recv_timeout(&mut self, timeout: Duration) -> Result<T, RecvTimeoutError>

Receive with timeout. Note that this may block slightly more than timeout if the pipe was written but the channel was not.

Readability of the fd is a hint that this will likely return a value, however this may return Empty and leave the fd readable in certain cases.

Trait Implementations§

Source§

impl<T> AsRawFd for MpscFdReceiver<T>

Available on Unix only.
Source§

fn as_raw_fd(&self) -> RawFd

Extracts the raw file descriptor. Read more
Source§

impl<'a, T> Into<BorrowedFd<'a>> for &'a MpscFdReceiver<T>

Available on Unix only.
Source§

fn into(self) -> BorrowedFd<'a>

Converts this type into the (usually inferred) input type.

Auto Trait Implementations§

§

impl<T> Freeze for MpscFdReceiver<T>

§

impl<T> RefUnwindSafe for MpscFdReceiver<T>

§

impl<T> Send for MpscFdReceiver<T>
where T: Send,

§

impl<T> !Sync for MpscFdReceiver<T>

§

impl<T> Unpin for MpscFdReceiver<T>

§

impl<T> UnsafeUnpin for MpscFdReceiver<T>

§

impl<T> UnwindSafe for MpscFdReceiver<T>

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 = 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>,

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.