[−][src]Struct rusty_junctions::channels::BidirChannel
Synchronous, bidirectional message channel.
This channel type is characterized by both the argument and return type of its
send_recv
method. A message can be sent through this channel which will then
also cause the channel to wait for a Join Pattern involving this channel to fire.
The subtle difference between using this channel type over a combination of a
SendChannel
and a RecvChannel
is that this channel ensures that Message
s
necessary to perform the sending and receiving happen atomically together. In
fact, only one Message
is sent for both. Therefore, a call to send_recv
can be viewed as an atomic operation, whereas a separate SendChannel::send
and RecvChannel::recv
may have an arbitrary amount of actions happen between
them.
Sending a message on this channel will block the current thread until a Join Pattern that this channel is part of has fired.
Methods
impl<T, R> BidirChannel<T, R> where
T: Any + Send,
R: Any + Send,
[src]
T: Any + Send,
R: Any + Send,
pub fn send_recv(&self, msg: T) -> Result<R, RecvError>
[src]
Send a message and receive value generated by fired Junction.
Panics
Panics if it was not possible to send the given message and return
Sender
to the Junction.
Trait Implementations
impl<T: Clone, R: Clone> Clone for BidirChannel<T, R>
[src]
fn clone(&self) -> BidirChannel<T, R>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl<T, R> !RefUnwindSafe for BidirChannel<T, R>
impl<T, R> Send for BidirChannel<T, R> where
R: Send,
T: Send,
R: Send,
T: Send,
impl<T, R> !Sync for BidirChannel<T, R>
impl<T, R> Unpin for BidirChannel<T, R> where
R: Unpin,
T: Unpin,
R: Unpin,
T: Unpin,
impl<T, R> !UnwindSafe for BidirChannel<T, R>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,