pub struct Changes<T: Clone + 'static> { /* private fields */ }Available on crate feature
async only.Expand description
A handle that resolves each time the configuration is replaced.
Runtime-agnostic, because it is a Future and nothing more: Embassy, RTIC
and a hand-written poll loop all drive it.
The configuration current when this was created counts as already seen, so
the first changed waits for the next one.
Implementations§
Source§impl<T: Clone + 'static> Changes<T>
impl<T: Clone + 'static> Changes<T>
Sourcepub fn changed(&mut self) -> impl Future<Output = T> + '_
pub fn changed(&mut self) -> impl Future<Output = T> + '_
Resolves with the configuration installed by the next change.
Changes that land while nothing is awaiting are not queued: waking up to the latest configuration is what a reader wants, and a queue would hand it stale ones first — which on a device means acting on a setting that has already been superseded.
Trait Implementations§
Auto Trait Implementations§
impl<T> !RefUnwindSafe for Changes<T>
impl<T> !UnwindSafe for Changes<T>
impl<T> Freeze for Changes<T>
impl<T> Send for Changes<T>where
T: Send,
impl<T> Sync for Changes<T>where
T: Send,
impl<T> Unpin for Changes<T>
impl<T> UnsafeUnpin for Changes<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