Struct zi::Layout

source · []
pub struct Layout(_);
Expand description

Represents a layout tree which is the main building block of a UI in Zi.

Each node in the layout tree is one

  1. A component, any type implementing Component.
  2. A flex container that groups multiple Layouts, represented by Container.
  3. A canvas which corresponds to the raw content in a region, represented by Canvas.

Implementations

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

This is a utility function that builds a container and converts it to a Layout. It is equivalent to calling Container::new(direction, items).into().

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 that builds a container and converts it to a Layout. It is equivalent to calling Container::column(items).into().

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.

This is a utility function that builds a container and converts it to a Layout. It is equivalent to calling Container::column_reverse(items).into().

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.

This is a utility function that builds a container and converts it to a Layout. It is equivalent to calling Container::row(items).into().

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.

This is a utility function that builds a container and converts it to a Layout. It is equivalent to calling Container::row_reverse(items).into().

Trait Implementations

Converts to this type from the input type.

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.