pub struct Receiver<T> { /* private fields */ }Expand description
Receive part of Sender.
Implementations§
Source§impl<T> Receiver<T>
impl<T> Receiver<T>
Sourcepub fn borrow_and_update(&mut self) -> Ref<'_, T>
pub fn borrow_and_update(&mut self) -> Ref<'_, T>
Borrows the latest value and marks it as seen.
Sourcepub async fn changed(&mut self) -> Result<Ref<'_, T>, RecvError>
pub async fn changed(&mut self) -> Result<Ref<'_, T>, RecvError>
Blocks and consumes new change since last Receiver::borrow_and_update or Receiver::changed().
If multiple values are published in the meantime, it is likely that only later one got observed. It is guaranteed that the final value after all Senders dropped is always observed.
§Errors
Trait Implementations§
impl<T> Send for Receiver<T>
impl<T> Sync for Receiver<T>
Auto Trait Implementations§
impl<T> Freeze for Receiver<T>
impl<T> !RefUnwindSafe for Receiver<T>
impl<T> Unpin for Receiver<T>
impl<T> !UnwindSafe for Receiver<T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more