Struct relm4::MicroComponent

source ·
pub struct MicroComponent<Model: MicroModel> { /* private fields */ }
Expand description

MicroComponent is a small component that lives in their parents model, can be modified from their parents model but at the same time have their own widgets and update function

Implementations§

Creates new MicroComponent

Updates a view of this MicroComponent

Returns model for this MicroComponent

Use this carefully and make sure reference is dropped. It’s using RefCell internally.

Returns mutable reference to model for this MicroComponent

Use this carefully and make sure reference is dropped. It’s using RefCell internally. If you don’t drop the reference any call to MicroComponent::update_view will fail.

Returns a mutable reference to the widgets of this MicroComponent or will fail when you already have a reference to the widgets

Use this carefully and make sure the reference to the widgets is dropped after use because otherwise the view function can’t be called as long you own the widgets (it uses RefCell internally).

Send a message to this MicroComponent. This can be used by the parent to send messages to this.

Get a sender to send messages to this MicroComponent.

Returns the root widget of this component’s widgets.

Returns true of the root widget is connected to a parent widget.

Tries to disconnect the root widget from its parent widget.

Returns true of the root widget was disconnected from the parent widget and false if nothing was done.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.