Struct heph_inbox::oneshot::Receiver [−][src]
The receiving half of the one-shot channel.
This half can only be owned and used by one thread.
Implementations
impl<T> Receiver<T>
[src]
pub fn try_recv(&mut self) -> Result<(T, Sender<T>), RecvError>
[src]
Attempts to receive a value and reset the channel.
If it succeeds it returns the value and resets the channel, returning a
new Sender
(which can send a value to this Receiver
).
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 the Sender
is
disconnected without sending a value. This is the same error as
RecvError::Disconnected
. RecvError::NoValue
will never be
returned, the Future
will return Poll::Pending
instead.
pub fn recv_once(self) -> RecvOnce<T>ⓘ
[src]
Returns an owned version of Receiver::recv
that can only be used
once.
See Receiver::recv
for more information.
pub fn try_reset(&mut self) -> Option<Sender<T>>
[src]
Attempt to reset the channel.
If the sender is disconnected this will return a new Sender
. If the
sender is still connected this will return None
.
Notes
If the channel contains a value it will be dropped.
pub fn is_connected(&self) -> bool
[src]
Returns true
if the Sender
is connected.
Trait Implementations
impl<T> Debug for Receiver<T>
[src]
impl<T> Drop for Receiver<T>
[src]
impl<T: Send> Send for Receiver<T>
[src]
impl<T: Send> Sync for Receiver<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> Unpin 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>,