pub struct WeakComponent<C> { /* private fields */ }Expand description
A handle that can be sent to a worker without keeping the component alive.
Implementations§
Source§impl<C: 'static> WeakComponent<C>
impl<C: 'static> WeakComponent<C>
Sourcepub fn upgrade(&self) -> Option<C>
pub fn upgrade(&self) -> Option<C>
Obtain the component on its owning thread while it is still alive.
Sourcepub fn upgrade_in_event_loop(
&self,
callback: impl FnOnce(C) + Send + 'static,
) -> Result<(), EventLoopError>
pub fn upgrade_in_event_loop( &self, callback: impl FnOnce(C) + Send + 'static, ) -> Result<(), EventLoopError>
Queue an update and run it on the UI thread if the component still exists.
Trait Implementations§
Auto Trait Implementations§
impl<C> Forget for WeakComponent<C>
impl<C> Freeze for WeakComponent<C>
impl<C> Move for WeakComponent<C>
impl<C> RefUnwindSafe for WeakComponent<C>
impl<C> Send for WeakComponent<C>
impl<C> Sync for WeakComponent<C>
impl<C> Unpin for WeakComponent<C>
impl<C> UnsafeUnpin for WeakComponent<C>
impl<C> UnwindSafe for WeakComponent<C>
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