pub struct LaunchedEffectScope { /* private fields */ }Implementations§
Source§impl LaunchedEffectScope
impl LaunchedEffectScope
pub fn is_active(&self) -> bool
pub fn runtime(&self) -> RuntimeHandle
Sourcepub fn launch(&self, task: impl FnOnce(LaunchedEffectScope) + 'static)
pub fn launch(&self, task: impl FnOnce(LaunchedEffectScope) + 'static)
Runs a follow-up LaunchedEffect task on the UI thread.
The provided closure executes on the runtime thread and may freely
capture Rc/RefCell state. This must only be called from the UI
thread, typically inside another effect callback.
Sourcepub fn post_ui(&self, task: impl FnOnce() + 'static)
pub fn post_ui(&self, task: impl FnOnce() + 'static)
Posts UI-only work that will execute on the runtime thread.
The closure never crosses threads, so it may capture non-Send values.
Callers must invoke this from the UI thread.
Sourcepub fn post_ui_send(&self, task: impl FnOnce() + Send + 'static)
pub fn post_ui_send(&self, task: impl FnOnce() + Send + 'static)
Posts work from any thread to run on the UI thread.
The closure must be Send because it may be sent across threads before
running on the runtime thread. Use this helper when posting from
background threads that need to interact with UI state.
Sourcepub fn launch_background<T, Work, Ui>(&self, work: Work, on_ui: Ui)
pub fn launch_background<T, Work, Ui>(&self, work: Work, on_ui: Ui)
Runs background work on a worker thread and delivers results to the UI.
work executes on a background thread, receives a cooperative
CancelToken, and must produce a Send value. The on_ui continuation
runs on the runtime thread, so it may capture Rc/RefCell state safely.
Trait Implementations§
Source§impl Clone for LaunchedEffectScope
impl Clone for LaunchedEffectScope
Source§fn clone(&self) -> LaunchedEffectScope
fn clone(&self) -> LaunchedEffectScope
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more