Struct heph_inbox::Receiver [−][src]
Receiving side of the channel.
Implementations
impl<T> Receiver<T>
[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]
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]
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 capacity(&self) -> usize
[src]
Returns the capacity of the channel.
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]
Returns true
if the Manager
is connected.
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.
pub fn id(&self) -> Id
[src]
Returns the id of this receiver.
Trait Implementations
impl<T: Debug> Debug for Receiver<T>
[src]
impl<T> Drop for Receiver<T>
[src]
impl<T: Send> Send for Receiver<T>
[src]
impl<T> Sync for Receiver<T>
[src]
impl<T> Unpin for Receiver<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> !UnwindSafe for Receiver<T>
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,
pub 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, 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.
pub 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>,