Skip to main content

BoxComponent

Struct BoxComponent 

Source
pub struct BoxComponent<M, Ev, Err>(/* private fields */);
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: Debug> Component for BoxComponent<M, Ev, Err>

Source§

type Error = Err

The error type.
Source§

type Event = Ev

The output event type to the parent.
Source§

type Init<'a> = Infallible

Initial parameter type.
Source§

type Message = M

The input message type to update.
Source§

async fn init( init: Self::Init<'_>, _sender: &ComponentSender<Self>, ) -> Result<Self, Self::Error>

Create the initial component.
Source§

async fn start(&mut self, sender: &ComponentSender<Self>) -> !

Start the event listening.
Source§

async fn update_children(&mut self) -> Result<bool, Self::Error>

Update the children components. Return true if any child needs render.
Source§

async fn update( &mut self, message: Self::Message, sender: &ComponentSender<Self>, ) -> Result<bool, Self::Error>

Respond to the message. Return true if need render.
Source§

fn render(&mut self, sender: &ComponentSender<Self>) -> Result<(), Self::Error>

Render the widgets.
Source§

fn render_children(&mut self) -> Result<(), Self::Error>

Render the children components. It will be called if any child or self needs render.
Source§

impl<M, Ev, Err> Debug for BoxComponent<M, Ev, Err>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

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> !UnwindSafe for BoxComponent<M, Ev, Err>

§

impl<M, Ev, Err> Freeze 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>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dest> IntoTuple<Dest> for Src
where Dest: FromTuple<Src>,

Source§

fn into_tuple(self) -> Dest

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.