Struct heph_inbox::Receiver [−][src]
pub struct Receiver<T> { /* fields omitted */ }
Expand description
Receiving side of the channel.
Implementations
impl<T> Receiver<T>
[src]
impl<T> Receiver<T>
[src]pub fn try_recv(&mut self) -> Result<T, RecvError>
[src]
pub fn try_recv(&mut self) -> Result<T, RecvError>
[src]Attempts to receive a value from this channel.
pub fn recv<'r>(&'r mut self) -> RecvValue<'r, T>ⓘ
[src]
pub fn recv<'r>(&'r mut self) -> RecvValue<'r, T>ⓘ
[src]Returns a future that receives a value from the channel, waiting if the channel is empty.
If the returned Future
returns None
it means all Sender
s are
disconnected. This is the same error as RecvError::Disconnected
.
RecvError::Empty
will never be returned, the Future
will return
Poll::Pending
instead.
pub fn new_sender(&self) -> Sender<T>
[src]
pub fn new_sender(&self) -> Sender<T>
[src]Create a new Sender
that sends to this channel.
Safety
The same restrictions apply to this function as they do to
Sender::clone
.
pub fn is_connected(&self) -> bool
[src]
pub fn is_connected(&self) -> bool
[src]Returns false
if all Sender
s are disconnected.
Notes
Unlike Sender::is_connected
this method doesn’t take the Manager
into account. This means that this method can return false
and later
true
(if the Manager
created another Sender
), which might be
unexpected.
pub fn has_manager(&self) -> bool
[src]
pub fn has_manager(&self) -> bool
[src]Returns true
if the Manager
is connected.
pub fn register_waker(&mut self, waker: &Waker) -> bool
[src]
pub fn register_waker(&mut self, waker: &Waker) -> bool
[src]Set the receiver’s waker to waker
, if they are different. Returns
true
if the waker is changed, false
otherwise.
This is useful if you can’t call Receiver::recv
but still want a
wake-up notification once messages are added to the inbox.