Container

Struct Container 

Source
pub struct Container {
    pub child: Node,
    pub align: Option<Alignment>,
    pub height: Option<Unit>,
    pub max_height: Option<Unit>,
    pub max_width: Option<Unit>,
    pub width: Option<Unit>,
    pub padding: Option<VecUnit>,
    pub margin: Option<VecUnit>,
    pub background_color: Option<Color>,
    pub border: Option<Border>,
    pub shadow: Option<BoxShadow>,
}
Expand description

To be honest, Container is a part of Flex family, but he is too brilliant to stay in Flex family, Layout calls him.

Fields§

§child: Node

Container child

§align: Option<Alignment>

Container align

§height: Option<Unit>

Container height

§max_height: Option<Unit>

SizedBox Max Height

§max_width: Option<Unit>

SizedBox Max Width

§width: Option<Unit>

Container width

§padding: Option<VecUnit>

Container padding

§margin: Option<VecUnit>

Container margin

§background_color: Option<Color>

Container background

§border: Option<Border>

Container Border

§shadow: Option<BoxShadow>

Box Shadow

Implementations§

Source§

impl Container

Source

pub fn new() -> Container

new Container

Source

pub fn child(self, v: impl Into<Node>) -> Self

Set child

Source

pub fn align(self, v: impl Into<Alignment>) -> Self

Set align

Source

pub fn height(self, v: impl Into<Unit>) -> Self

Set height

Source

pub fn max_height(self, v: impl Into<Unit>) -> Self

Set max_height

Source

pub fn max_width(self, v: impl Into<Unit>) -> Self

Set max_width

Source

pub fn width(self, v: impl Into<Unit>) -> Self

Set width

Source

pub fn padding(self, v: impl Into<VecUnit>) -> Self

Set padding

Source

pub fn margin(self, v: impl Into<VecUnit>) -> Self

Set margin

Source

pub fn background_color(self, v: impl Into<Color>) -> Self

Set background_color

Source

pub fn border(self, v: impl Into<Border>) -> Self

Set border

Source

pub fn shadow(self, v: impl Into<BoxShadow>) -> Self

Set shadow

Source§

impl Container

Source

pub fn with(child: impl Into<Node>) -> Container

Shortcut of Container::new().child(impl Into<Node>)

Trait Implementations§

Source§

impl Default for Container

Source§

fn default() -> Container

Returns the “default value” for a type. Read more
Source§

impl Into<Node> for Container

Source§

fn into(self) -> Node

Converts this type into the (usually inferred) input type.
Source§

impl StyleWrapper for Container

Source§

fn wrap(self) -> Node

Converet widget to node

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> AlignItems for T
where T: Into<Node>,

Source§

fn align_items(self, value: FlexPosition) -> Node

AlignItem Style
Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> BackgroundColor for T
where T: Into<Node>,

Source§

fn background_color(self, value: Color) -> Node

Custom Color
Source§

impl<T> Border for T
where T: Into<Node>,

Source§

fn border(self, value: BoxBorder) -> Node

Border Border
Source§

impl<T> BorderBottom for T
where T: Into<Node>,

Source§

fn border_bottom(self, value: BoxBorder) -> Node

Border Bottom
Source§

impl<T> BorderLeft for T
where T: Into<Node>,

Source§

fn border_left(self, value: BoxBorder) -> Node

Border Left
Source§

impl<T> BorderRight for T
where T: Into<Node>,

Source§

fn border_right(self, value: BoxBorder) -> Node

Border Right
Source§

impl<T> BorderTop for T
where T: Into<Node>,

Source§

fn border_top(self, value: BoxBorder) -> Node

Border Top
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> Bottom for T
where T: Into<Node>,

Source§

fn bottom(self, value: Unit) -> Node

Box Bottom
Source§

impl<T> Color for T
where T: Into<Node>,

Source§

fn color(self, value: Color) -> Node

Custom Color
Source§

impl<T> ColumnCount for T
where T: Into<Node>,

Source§

fn column_count(self, value: Unit) -> Node

ColumnCount Style
Source§

impl<T> ColumnGap for T
where T: Into<Node>,

Source§

fn column_gap(self, value: Unit) -> Node

ColumnGap Style
Source§

impl<T> ColumnRuleColor for T
where T: Into<Node>,

Source§

fn column_rule_color(self, value: Color) -> Node

ColumnRuleColor Style
Source§

impl<T> ColumnRuleStyle for T
where T: Into<Node>,

Source§

fn column_rule_style(self, value: MultiColumnLineStyle) -> Node

ColumnRuleStyle Style
Source§

impl<T> FlexGrow for T
where T: Into<Node>,

Source§

fn flex_glow(self, value: Unit) -> Node

FlexGrow Style
Source§

impl<T> FontSize for T
where T: Into<Node>,

Source§

fn font_size(self, value: Unit) -> Node

Font Size Style
Source§

impl<T> FontStretch for T
where T: Into<Node>,

Source§

fn font_stretch(self, value: Unit) -> Node

Font Stretch Style
Source§

impl<T> FontWeight for T
where T: Into<Node>,

Source§

fn font_weight(self, value: Unit) -> Node

Font Weight Style
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> GridAutoColumns for T
where T: Into<Node>,

Source§

fn grid_auto_columns(self, value: GridAuto) -> Node

GridAutoColumn Style
Source§

impl<T> GridAutoFlow for T
where T: Into<Node>,

Source§

fn grid_auto_flow(self, value: GridFlow) -> Node

GridAutoFlow Style
Source§

impl<T> GridAutoRows for T
where T: Into<Node>,

Source§

fn grid_auto_rows(self, value: GridAuto) -> Node

GridAutoColumn Style
Source§

impl<T> GridColumnGap for T
where T: Into<Node>,

Source§

fn grid_column_gap(self, value: Unit) -> Node

GridColumnGap Style
Source§

impl<T> GridRowGap for T
where T: Into<Node>,

Source§

fn grid_row_rap(self, value: Unit) -> Node

GridColumnGap Style
Source§

impl<T> GridTemplateColumns for T
where T: Into<Node>,

Source§

fn grid_template_columns(self, value: GridTemplate) -> Node

GridTemplateColumns Style
Source§

impl<T> GridTemplateRows for T
where T: Into<Node>,

Source§

fn grid_tempalte_row(self, value: GridTemplate) -> Node

GridTemplateRow Style
Source§

impl<T> Height for T
where T: Into<Node>,

Source§

fn height(self, value: Unit) -> Node

Box Height
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> JustifyContent for T
where T: Into<Node>,

Source§

fn justify_content(self, value: FlexPosition) -> Node

AlignItem Style
Source§

impl<T> Left for T
where T: Into<Node>,

Source§

fn left(self, value: Unit) -> Node

Box Left
Source§

impl<T> LineHeight for T
where T: Into<Node>,

Source§

fn line_hegiht(self, value: Unit) -> Node

Line Height Style
Source§

impl<T> Margin for T
where T: Into<Node>,

Source§

fn margin(self, value: VecUnit) -> Node

Box Margin
Source§

impl<T> MarginBottom for T
where T: Into<Node>,

Source§

fn margin_bottom(self, value: Unit) -> Node

Margin Bottom
Source§

impl<T> MarginLeft for T
where T: Into<Node>,

Source§

fn margin_left(self, value: Unit) -> Node

Margin left
Source§

impl<T> MarginRight for T
where T: Into<Node>,

Source§

fn margin_right(self, value: Unit) -> Node

Margin right
Source§

impl<T> MarginTop for T
where T: Into<Node>,

Source§

fn margin_top(self, value: Unit) -> Node

Margin Top
Source§

impl<T> MaxHeight for T
where T: Into<Node>,

Source§

fn max_height(self, value: Unit) -> Node

Box Max Height
Source§

impl<T> MaxWidth for T
where T: Into<Node>,

Source§

fn max_width(self, value: Unit) -> Node

Box Max Width
Source§

impl<T> Order for T
where T: Into<Node>,

Source§

fn order(self, value: Unit) -> Node

FlexOrder Style
Source§

impl<T> OutlineWidth for T
where T: Into<Node>,

Source§

fn outline_width(self, value: Unit) -> Node

Box Outline Width
Source§

impl<T> Padding for T
where T: Into<Node>,

Source§

fn padding(self, value: VecUnit) -> Node

Box Padding
Source§

impl<T> PaddingBottom for T
where T: Into<Node>,

Source§

fn padding_bottom(self, value: Unit) -> Node

Padding Bottom
Source§

impl<T> PaddingLeft for T
where T: Into<Node>,

Source§

fn padding_left(self, value: Unit) -> Node

Padding left
Source§

impl<T> PaddingRight for T
where T: Into<Node>,

Source§

fn padding_right(self, value: Unit) -> Node

Padding right
Source§

impl<T> PaddingTop for T
where T: Into<Node>,

Source§

fn padding_top(self, value: Unit) -> Node

Padding Top
Source§

impl<T> Right for T
where T: Into<Node>,

Source§

fn right(self, value: Unit) -> Node

Box Right
Source§

impl<T> Top for T
where T: Into<Node>,

Source§

fn top(self, value: Unit) -> Node

Box Top
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Width for T
where T: Into<Node>,

Source§

fn width(self, value: Unit) -> Node

Box Width