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
Implementations
sourceimpl Layout
impl Layout
sourcepub fn container(
direction: FlexDirection,
items: impl IntoIterator<Item = Item>
) -> Self
pub fn container(
direction: FlexDirection,
items: impl IntoIterator<Item = Item>
) -> Self
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()
.
sourcepub fn column(items: impl IntoIterator<Item = Item>) -> Self
pub fn column(items: impl IntoIterator<Item = Item>) -> Self
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()
.
sourcepub fn column_reverse(items: impl IntoIterator<Item = Item>) -> Self
pub fn column_reverse(items: impl IntoIterator<Item = Item>) -> Self
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()
.
sourcepub fn row(items: impl IntoIterator<Item = Item>) -> Self
pub fn row(items: impl IntoIterator<Item = Item>) -> Self
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()
.
sourcepub fn row_reverse(items: impl IntoIterator<Item = Item>) -> Self
pub fn row_reverse(items: impl IntoIterator<Item = Item>) -> Self
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
Auto Trait Implementations
impl !RefUnwindSafe for Layout
impl !Send for Layout
impl !Sync for Layout
impl Unpin for Layout
impl !UnwindSafe for Layout
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more