Trait IntoView

Source
pub trait IntoView<A> {
    // Required method
    fn into_view(self) -> View<A>;
}
Expand description

Converts a declarative widget builder into a runtime View node.

Application code returns View<A> and calls .into_view() on the root builder (re-export this trait in the app view/prelude, not in ailloli_ui::prelude). Framework uses it for .child, Window::content, and custom widgets.

§Examples

use ailloli_ui_runtime::component::{IntoView, View};
let view: View<()> = View::empty().into_view();
assert!(view.children.is_empty());

Required Methods§

Source

fn into_view(self) -> View<A>

Consumes a builder/value and returns its declarative view tree.

§Examples
use ailloli_ui_runtime::component::{IntoView, View};
let view: View<()> = IntoView::into_view(View::empty());
assert!(view.key.is_none());

Implementors§

Source§

impl<A> IntoView<A> for View<A>

Implements the IntoView<A> contract for View<A>.

Source§

impl<P, A, F> IntoView<A> for Component<P, A, F>
where P: Clone + 'static, A: 'static, F: Fn(&mut Context<A>, P) -> View<A> + 'static,