cushy::widget

Trait IntoWidgetList

Source
pub trait IntoWidgetList: Sized {
    // Required method
    fn into_widget_list(self) -> Value<WidgetList>;

    // Provided methods
    fn into_rows(self) -> Stack { ... }
    fn into_columns(self) -> Stack { ... }
    fn into_layers(self) -> Layers { ... }
    fn into_wrap(self) -> Wrap { ... }
    fn into_list(self) -> List { ... }
}
Expand description

A type that can be converted to a Value<WidgetList>.

use cushy::widget::{IntoWidgetList, MakeWidget};

vec!["hello", "label"].into_rows();

vec!["hello", "button"]
    .into_iter()
    .map(|l| l.into_button())
    .into_columns();

Required Methods§

Source

fn into_widget_list(self) -> Value<WidgetList>

Returns this list of widgets as a Value<WidgetList>.

Provided Methods§

Source

fn into_rows(self) -> Stack

Returns self as a vertical Stack of rows.

Source

fn into_columns(self) -> Stack

Returns self as a horizontal Stack of columns.

Source

fn into_layers(self) -> Layers

Returns self as Layers, with the widgets being stacked in the Z direction.

Source

fn into_wrap(self) -> Wrap

Returns a Wrap that lays the children out horizontally, wrapping into additional rows as needed.

Source

fn into_list(self) -> List

Returns self as an unordered List.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§