pub struct SignalReader<'a, T: Copy> { /* private fields */ }
Expand description
Facilitates the async reading of values from the Signal.
Implementations§
source§impl<'a, T: Copy> SignalReader<'a, T>
impl<'a, T: Copy> SignalReader<'a, T>
sourcepub fn try_read(&mut self) -> Option<T>
pub fn try_read(&mut self) -> Option<T>
Returns a pending value if present, or None if no value is available.
Upon read, the stored value is evicted.
sourcepub async fn wait(&mut self) -> T
pub async fn wait(&mut self) -> T
Wait for a new value to be written and read it.
If a value is already pending it will be returned immediately.
Upon read, the stored value is evicted.
sourcepub async fn wait_fresh(&mut self) -> T
pub async fn wait_fresh(&mut self) -> T
Wait for a new value to be written and read it.
If a value is already pending, it will be evicted and a new value must be written for the wait to resolve.
Upon read, the stored value is evicted.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T> Freeze for SignalReader<'a, T>
impl<'a, T> !RefUnwindSafe for SignalReader<'a, T>
impl<'a, T> Send for SignalReader<'a, T>
impl<'a, T> Sync for SignalReader<'a, T>
impl<'a, T> Unpin for SignalReader<'a, T>
impl<'a, T> !UnwindSafe for SignalReader<'a, 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