pub struct ComponentContext<C: Component> { /* private fields */ }Expand description
Capabilities available while creating or updating a component.
Messages sent through this context are queued and delivered after the current lifecycle call.
Implementations§
Source§impl<C: Component> ComponentContext<C>
impl<C: Component> ComponentContext<C>
Sourcepub fn open_window(&self, root: View) -> bool
pub fn open_window(&self, root: View) -> bool
Requests a new application-owned window with an independent Pump.
Sourcepub fn sender(&self) -> LocalSender<C::Message>
pub fn sender(&self) -> LocalSender<C::Message>
Returns a sender bound to this component instance.
Sourcepub fn spawn_background<F>(&self, work: F) -> ComponentTask
pub fn spawn_background<F>(&self, work: F) -> ComponentTask
Starts scope-owned work on the Windows thread pool.
Expected application failures should be represented in the returned message. A panic in
work or failure to submit to the Windows thread pool is fatal.
Sourcepub fn spawn_background_with_rejection<F>(
&self,
work: F,
rejected: C::Message,
) -> ComponentTask
pub fn spawn_background_with_rejection<F>( &self, work: F, rejected: C::Message, ) -> ComponentTask
Starts scope-owned work and dispatches rejected if bounded delivery rejects it.
Cancellation and scope retirement do not dispatch rejected. A panic in work or failure
to submit to the Windows thread pool is fatal.
Auto Trait Implementations§
impl<C> !RefUnwindSafe for ComponentContext<C>
impl<C> !Send for ComponentContext<C>
impl<C> !Sync for ComponentContext<C>
impl<C> !UnwindSafe for ComponentContext<C>
impl<C> Freeze for ComponentContext<C>
impl<C> Unpin for ComponentContext<C>
impl<C> UnsafeUnpin for ComponentContext<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