pub struct Container { /* private fields */ }
Expand description

A flex container with a specified direction and items.

Implementations

Creates a new flex container with a specified direction and containing the provided items.

Example
let container = Container::new(
    FlexDirection::Column,
    [
        Item::auto(Text::with(TextProperties::new().content("Item 1"))),
        Item::auto(Text::with(TextProperties::new().content("Item 2"))),
    ],
);

Creates a new empty flex container with a specified direction.

Adds an item to the end of the container.

Example
let mut container = Container::empty(FlexDirection::Row);
container
    .push(Item::auto(Text::with(TextProperties::new().content("Item 1"))))
    .push(Item::auto(Text::with(TextProperties::new().content("Item 2"))));

Creates a container with column (vertical) layout.

Child components are laid out from top to bottom. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.

This is a utility function and it is equivalent to calling Container::new(FlexDirection::Column, items).

Creates a container with reversed column (vertical) layout.

Child components are laid out from bottom to top. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.

Creates a container with row (horizontal) layout.

Child components are laid out from left to right. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.

Creates a container with reversed row (horizontal) layout.

Child components are laid out from right to left. Pass in the children as an something that can be converted to an iterator of items, e.g. an array of items.

Trait Implementations

Converts to this type from the input type.

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.