pub struct BoxElement<Msg> {
pub children: Vec<Element<Msg>>,
pub style: BoxStyle,
/* private fields */
}Expand description
A Flexbox container element that holds child elements.
Use the builder pattern to configure layout and styling:
use a3s_tui::element::{BoxElement, FlexDirection, BorderStyle, Dimension};
let container = BoxElement::<()>::new()
.direction(FlexDirection::Column)
.padding(1)
.gap(1)
.border(BorderStyle::Rounded)
.width(Dimension::Percent(100.0));Fields§
§children: Vec<Element<Msg>>§style: BoxStyleImplementations§
Source§impl<Msg> BoxElement<Msg>
impl<Msg> BoxElement<Msg>
pub fn new() -> Self
pub fn direction(self, d: FlexDirection) -> Self
pub fn child(self, el: Element<Msg>) -> Self
pub fn children(self, els: Vec<Element<Msg>>) -> Self
pub fn padding(self, all: u16) -> Self
pub fn padding_xy(self, x: u16, y: u16) -> Self
pub fn margin(self, all: u16) -> Self
pub fn border(self, style: BorderStyle) -> Self
pub fn border_color(self, c: Color) -> Self
pub fn gap(self, g: u16) -> Self
pub fn flex_grow(self, g: f32) -> Self
pub fn flex_shrink(self, s: f32) -> Self
pub fn flex_basis(self, d: Dimension) -> Self
pub fn width(self, d: Dimension) -> Self
pub fn height(self, d: Dimension) -> Self
pub fn min_width(self, d: Dimension) -> Self
pub fn max_width(self, d: Dimension) -> Self
pub fn min_height(self, d: Dimension) -> Self
pub fn max_height(self, d: Dimension) -> Self
pub fn bg(self, c: Color) -> Self
pub fn align_items(self, a: AlignItems) -> Self
pub fn justify_content(self, j: JustifyContent) -> Self
pub fn overflow(self, o: Overflow) -> Self
Trait Implementations§
Auto Trait Implementations§
impl<Msg> Freeze for BoxElement<Msg>
impl<Msg> RefUnwindSafe for BoxElement<Msg>where
Msg: RefUnwindSafe,
impl<Msg> Send for BoxElement<Msg>where
Msg: Send,
impl<Msg> Sync for BoxElement<Msg>where
Msg: Sync,
impl<Msg> Unpin for BoxElement<Msg>where
Msg: Unpin,
impl<Msg> UnsafeUnpin for BoxElement<Msg>
impl<Msg> UnwindSafe for BoxElement<Msg>where
Msg: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more