pub struct Waker(/* private fields */);Expand description
A handle into the event loop that any thread may hold; Waker::wake
asks for a frame from wherever the app’s data arrived. Cheap to clone,
and harmless after the loop has ended (a wake nobody hears is dropped).
An app gets one in App::setup, a host from PumpRunner::waker.
Implementations§
Source§impl Waker
impl Waker
Sourcepub fn wake(&self)
pub fn wake(&self)
Asks every window for a frame: the loop wakes, view runs and the
frame is drawn. Safe from any thread and at any rate, since wakes
coalesce into the loop’s next turn rather than queueing frames.
Sourcepub fn wake_at(&self, at: Instant)
pub fn wake_at(&self, at: Instant)
Asks every window for a frame at at (backlog F135): the loop
sleeps until then and view runs, with no thread waiting for it.
The earliest time asked for wins; one already past is a wake now.
From the view itself Ui::request_frame_at, on the frame clock,
says the same thing without a Waker.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Waker
impl RefUnwindSafe for Waker
impl Send for Waker
impl Sync for Waker
impl Unpin for Waker
impl UnsafeUnpin for Waker
impl UnwindSafe for Waker
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.