Struct BiChannel

Source
pub struct BiChannel<T, U> {
    pub rx: Receiver<T>,
    pub tx: Sender<U>,
}
Expand description

Bi-directional communication build on, and usable with, crossbeam-channel channels.

Fields§

§rx: Receiver<T>§tx: Sender<U>

Implementations§

Source§

impl<T, U> BiChannel<T, U>

Source

pub fn new(tx: Sender<U>, rx: Receiver<T>) -> Self

Source

pub fn send(&self, msg: U)

Source

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

Trait Implementations§

Source§

impl<'a, T, U> RecvArgument<'a, T> for &'a BiChannel<T, U>

Source§

type Iter = IntoIter<&'a Receiver<T>>

Source§

fn _as_recv_argument(&'a self) -> Self::Iter

Converts the argument into an iterator over receivers.
Source§

impl<'a, T, U> SendArgument<'a, T> for &'a BiChannel<U, T>

Source§

type Iter = IntoIter<&'a Sender<T>>

Source§

fn _as_send_argument(&'a self) -> Self::Iter

Converts the argument into an iterator over senders.

Auto Trait Implementations§

§

impl<T, U> !Freeze for BiChannel<T, U>

§

impl<T, U> RefUnwindSafe for BiChannel<T, U>

§

impl<T, U> Send for BiChannel<T, U>
where T: Send, U: Send,

§

impl<T, U> Sync for BiChannel<T, U>
where T: Send, U: Send,

§

impl<T, U> Unpin for BiChannel<T, U>

§

impl<T, U> UnwindSafe for BiChannel<T, U>

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.
Source§

impl<T> Erased for T