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 launch_background<T, Work, Ui, Fut>(&self, work: Work, on_ui: Ui)
pub fn launch_background<T, Work, Ui, Fut>(&self, work: Work, on_ui: Ui)
Runs background work and delivers results to the UI.
On native targets, work runs on a worker thread and its future is
driven to completion there. On WASM, work runs as a task on the
browser event loop. The on_ui continuation always 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
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 LaunchedEffectScope
impl !Send for LaunchedEffectScope
impl !Sync for LaunchedEffectScope
impl !UnwindSafe for LaunchedEffectScope
impl Freeze for LaunchedEffectScope
impl Unpin for LaunchedEffectScope
impl UnsafeUnpin for LaunchedEffectScope
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