pub struct BoxComponent<M, Ev, Err>(/* private fields */);Available on crate feature
winio only.Expand description
A boxed component. It is not initialized directly, but constructed by
Child::into_boxed or Root::into_boxed.
Trait Implementations§
Source§impl<M, Ev, Err> Component for BoxComponent<M, Ev, Err>where
Err: Debug,
impl<M, Ev, Err> Component for BoxComponent<M, Ev, Err>where
Err: Debug,
Source§type Init<'a> = Infallible
type Init<'a> = Infallible
Initial parameter type.
Source§async fn init(
init: <BoxComponent<M, Ev, Err> as Component>::Init<'_>,
_sender: &ComponentSender<BoxComponent<M, Ev, Err>>,
) -> Result<BoxComponent<M, Ev, Err>, <BoxComponent<M, Ev, Err> as Component>::Error>
async fn init( init: <BoxComponent<M, Ev, Err> as Component>::Init<'_>, _sender: &ComponentSender<BoxComponent<M, Ev, Err>>, ) -> Result<BoxComponent<M, Ev, Err>, <BoxComponent<M, Ev, Err> as Component>::Error>
Create the initial component.
Source§async fn start(
&mut self,
sender: &ComponentSender<BoxComponent<M, Ev, Err>>,
) -> !
async fn start( &mut self, sender: &ComponentSender<BoxComponent<M, Ev, Err>>, ) -> !
Start the event listening.
Source§async fn update_children(
&mut self,
) -> Result<bool, <BoxComponent<M, Ev, Err> as Component>::Error>
async fn update_children( &mut self, ) -> Result<bool, <BoxComponent<M, Ev, Err> as Component>::Error>
Update the children components. Return true if any child needs render.
Source§async fn update(
&mut self,
message: <BoxComponent<M, Ev, Err> as Component>::Message,
sender: &ComponentSender<BoxComponent<M, Ev, Err>>,
) -> Result<bool, <BoxComponent<M, Ev, Err> as Component>::Error>
async fn update( &mut self, message: <BoxComponent<M, Ev, Err> as Component>::Message, sender: &ComponentSender<BoxComponent<M, Ev, Err>>, ) -> Result<bool, <BoxComponent<M, Ev, Err> as Component>::Error>
Respond to the message. Return true if need render.
Source§fn render(
&mut self,
sender: &ComponentSender<BoxComponent<M, Ev, Err>>,
) -> Result<(), <BoxComponent<M, Ev, Err> as Component>::Error>
fn render( &mut self, sender: &ComponentSender<BoxComponent<M, Ev, Err>>, ) -> Result<(), <BoxComponent<M, Ev, Err> as Component>::Error>
Render the widgets.
Source§fn render_children(
&mut self,
) -> Result<(), <BoxComponent<M, Ev, Err> as Component>::Error>
fn render_children( &mut self, ) -> Result<(), <BoxComponent<M, Ev, Err> as Component>::Error>
Render the children components. It will be called if any child or self
needs render.
Auto Trait Implementations§
impl<M, Ev, Err> Freeze for BoxComponent<M, Ev, Err>
impl<M, Ev, Err> !RefUnwindSafe for BoxComponent<M, Ev, Err>
impl<M, Ev, Err> !Send for BoxComponent<M, Ev, Err>
impl<M, Ev, Err> !Sync for BoxComponent<M, Ev, Err>
impl<M, Ev, Err> Unpin for BoxComponent<M, Ev, Err>
impl<M, Ev, Err> UnsafeUnpin for BoxComponent<M, Ev, Err>
impl<M, Ev, Err> !UnwindSafe for BoxComponent<M, Ev, Err>
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
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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more