Struct druid_shell::IdleHandle
source · pub struct IdleHandle(_);Expand description
A handle that can enqueue tasks on the window loop.
Implementations§
source§impl IdleHandle
impl IdleHandle
sourcepub fn add_idle<F>(&self, callback: F)where
F: FnOnce(&mut dyn WinHandler) + Send + 'static,
pub fn add_idle<F>(&self, callback: F)where
F: FnOnce(&mut dyn WinHandler) + Send + 'static,
Add an idle handler, which is called (once) when the message loop is empty. The idle handler will be run from the main UI thread, and won’t be scheduled if the associated view has been dropped.
Note: the name “idle” suggests that it will be scheduled with a lower priority than other UI events, but that’s not necessarily the case.
sourcepub fn schedule_idle(&mut self, token: IdleToken)
pub fn schedule_idle(&mut self, token: IdleToken)
Request a callback from the runloop. Your WinHander::idle method will
be called with the token that was passed in.
Trait Implementations§
source§impl Clone for IdleHandle
impl Clone for IdleHandle
source§fn clone(&self) -> IdleHandle
fn clone(&self) -> IdleHandle
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for IdleHandle
impl Send for IdleHandle
impl Sync for IdleHandle
impl Unpin for IdleHandle
impl !UnwindSafe for IdleHandle
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> RoundFrom<T> for T
impl<T> RoundFrom<T> for T
§fn round_from(x: T) -> T
fn round_from(x: T) -> T
Performs the conversion.
§impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
impl<T, U> RoundInto<U> for Twhere
U: RoundFrom<T>,
§fn round_into(self) -> U
fn round_into(self) -> U
Performs the conversion.