Struct Container

Source
pub struct Container {
Show 96 fields pub id: usize, pub str_id: Option<String>, pub classes: Vec<String>, pub data: HashMap<String, String>, pub element: Element, pub children: Vec<Container>, pub direction: LayoutDirection, pub overflow_x: LayoutOverflow, pub overflow_y: LayoutOverflow, pub grid_cell_size: Option<Number>, pub justify_content: Option<JustifyContent>, pub align_items: Option<AlignItems>, pub text_align: Option<TextAlign>, pub text_decoration: Option<TextDecoration>, pub font_family: Option<Vec<String>>, pub width: Option<Number>, pub min_width: Option<Number>, pub max_width: Option<Number>, pub height: Option<Number>, pub min_height: Option<Number>, pub max_height: Option<Number>, pub flex: Option<Flex>, pub column_gap: Option<Number>, pub row_gap: Option<Number>, pub opacity: Option<Number>, pub left: Option<Number>, pub right: Option<Number>, pub top: Option<Number>, pub bottom: Option<Number>, pub translate_x: Option<Number>, pub translate_y: Option<Number>, pub cursor: Option<Cursor>, pub position: Option<Position>, pub background: Option<Color>, pub border_top: Option<(Color, Number)>, pub border_right: Option<(Color, Number)>, pub border_bottom: Option<(Color, Number)>, pub border_left: Option<(Color, Number)>, pub border_top_left_radius: Option<Number>, pub border_top_right_radius: Option<Number>, pub border_bottom_left_radius: Option<Number>, pub border_bottom_right_radius: Option<Number>, pub margin_left: Option<Number>, pub margin_right: Option<Number>, pub margin_top: Option<Number>, pub margin_bottom: Option<Number>, pub padding_left: Option<Number>, pub padding_right: Option<Number>, pub padding_top: Option<Number>, pub padding_bottom: Option<Number>, pub font_size: Option<Number>, pub color: Option<Color>, pub state: Option<Value>, pub hidden: Option<bool>, pub debug: Option<bool>, pub visibility: Option<Visibility>, pub route: Option<Route>, pub actions: Vec<Action>, pub overrides: Vec<ConfigOverride>, pub calculated_margin_left: Option<f32>, pub calculated_margin_right: Option<f32>, pub calculated_margin_top: Option<f32>, pub calculated_margin_bottom: Option<f32>, pub calculated_padding_left: Option<f32>, pub calculated_padding_right: Option<f32>, pub calculated_padding_top: Option<f32>, pub calculated_padding_bottom: Option<f32>, pub calculated_min_width: Option<f32>, pub calculated_child_min_width: Option<f32>, pub calculated_max_width: Option<f32>, pub calculated_preferred_width: Option<f32>, pub calculated_width: Option<f32>, pub calculated_min_height: Option<f32>, pub calculated_child_min_height: Option<f32>, pub calculated_max_height: Option<f32>, pub calculated_preferred_height: Option<f32>, pub calculated_height: Option<f32>, pub calculated_x: Option<f32>, pub calculated_y: Option<f32>, pub calculated_position: Option<LayoutPosition>, pub calculated_border_top: Option<(Color, f32)>, pub calculated_border_right: Option<(Color, f32)>, pub calculated_border_bottom: Option<(Color, f32)>, pub calculated_border_left: Option<(Color, f32)>, pub calculated_border_top_left_radius: Option<f32>, pub calculated_border_top_right_radius: Option<f32>, pub calculated_border_bottom_left_radius: Option<f32>, pub calculated_border_bottom_right_radius: Option<f32>, pub calculated_column_gap: Option<f32>, pub calculated_row_gap: Option<f32>, pub calculated_opacity: Option<f32>, pub calculated_font_size: Option<f32>, pub scrollbar_right: Option<f32>, pub scrollbar_bottom: Option<f32>, pub calculated_offset_x: Option<f32>, pub calculated_offset_y: Option<f32>,
}

Fields§

§id: usize§str_id: Option<String>§classes: Vec<String>§data: HashMap<String, String>§element: Element§children: Vec<Container>§direction: LayoutDirection§overflow_x: LayoutOverflow§overflow_y: LayoutOverflow§grid_cell_size: Option<Number>§justify_content: Option<JustifyContent>§align_items: Option<AlignItems>§text_align: Option<TextAlign>§text_decoration: Option<TextDecoration>§font_family: Option<Vec<String>>§width: Option<Number>§min_width: Option<Number>§max_width: Option<Number>§height: Option<Number>§min_height: Option<Number>§max_height: Option<Number>§flex: Option<Flex>§column_gap: Option<Number>§row_gap: Option<Number>§opacity: Option<Number>§left: Option<Number>§right: Option<Number>§top: Option<Number>§bottom: Option<Number>§translate_x: Option<Number>§translate_y: Option<Number>§cursor: Option<Cursor>§position: Option<Position>§background: Option<Color>§border_top: Option<(Color, Number)>§border_right: Option<(Color, Number)>§border_bottom: Option<(Color, Number)>§border_left: Option<(Color, Number)>§border_top_left_radius: Option<Number>§border_top_right_radius: Option<Number>§border_bottom_left_radius: Option<Number>§border_bottom_right_radius: Option<Number>§margin_left: Option<Number>§margin_right: Option<Number>§margin_top: Option<Number>§margin_bottom: Option<Number>§padding_left: Option<Number>§padding_right: Option<Number>§padding_top: Option<Number>§padding_bottom: Option<Number>§font_size: Option<Number>§color: Option<Color>§state: Option<Value>§hidden: Option<bool>§debug: Option<bool>§visibility: Option<Visibility>§route: Option<Route>§actions: Vec<Action>§overrides: Vec<ConfigOverride>§calculated_margin_left: Option<f32>§calculated_margin_right: Option<f32>§calculated_margin_top: Option<f32>§calculated_margin_bottom: Option<f32>§calculated_padding_left: Option<f32>§calculated_padding_right: Option<f32>§calculated_padding_top: Option<f32>§calculated_padding_bottom: Option<f32>§calculated_min_width: Option<f32>§calculated_child_min_width: Option<f32>§calculated_max_width: Option<f32>§calculated_preferred_width: Option<f32>§calculated_width: Option<f32>§calculated_min_height: Option<f32>§calculated_child_min_height: Option<f32>§calculated_max_height: Option<f32>§calculated_preferred_height: Option<f32>§calculated_height: Option<f32>§calculated_x: Option<f32>§calculated_y: Option<f32>§calculated_position: Option<LayoutPosition>§calculated_border_top: Option<(Color, f32)>§calculated_border_right: Option<(Color, f32)>§calculated_border_bottom: Option<(Color, f32)>§calculated_border_left: Option<(Color, f32)>§calculated_border_top_left_radius: Option<f32>§calculated_border_top_right_radius: Option<f32>§calculated_border_bottom_left_radius: Option<f32>§calculated_border_bottom_right_radius: Option<f32>§calculated_column_gap: Option<f32>§calculated_row_gap: Option<f32>§calculated_opacity: Option<f32>§calculated_font_size: Option<f32>§scrollbar_right: Option<f32>§scrollbar_bottom: Option<f32>§calculated_offset_x: Option<f32>§calculated_offset_y: Option<f32>

Implementations§

Source§

impl Container

Source

pub fn margin_x(&self) -> Option<f32>

Source§

impl Container

Source

pub fn margin_y(&self) -> Option<f32>

Source§

impl Container

Source

pub fn padding_x(&self) -> Option<f32>

Source§

impl Container

Source

pub fn padding_y(&self) -> Option<f32>

Source§

impl Container

Source§

impl Container

Source

pub fn iter_overrides( &self, recurse: bool, ) -> impl Iterator<Item = (&Self, &ConfigOverride)>

Source

pub fn bfs(&self) -> BfsPaths

Source

pub fn bfs_visit(&self, visitor: impl FnMut(&Self)) -> BfsPaths

Source

pub fn bfs_visit_mut(&mut self, visitor: impl FnMut(&mut Self)) -> BfsPaths

Source§

impl Container

Source

pub const fn is_fixed(&self) -> bool

Source

pub const fn is_raw(&self) -> bool

Source§

impl Container

Source

pub fn is_visible(&self) -> bool

Source

pub fn is_hidden(&self) -> bool

Source

pub fn is_span(&self) -> bool

Source

pub fn is_flex_container(&self) -> bool

Source

pub fn visible_elements(&self) -> impl Iterator<Item = &Self>

Source

pub fn visible_elements_mut(&mut self) -> impl Iterator<Item = &mut Self>

Source

pub fn relative_positioned_elements(&self) -> impl Iterator<Item = &Self>

Source

pub fn relative_positioned_elements_mut( &mut self, ) -> impl Iterator<Item = &mut Self>

Source

pub fn absolute_positioned_elements(&self) -> impl Iterator<Item = &Self>

Source

pub fn absolute_positioned_elements_mut( &mut self, ) -> impl Iterator<Item = &mut Self>

Source

pub fn fixed_positioned_elements(&self) -> impl Iterator<Item = &Self>

Source

pub fn fixed_positioned_elements_mut( &mut self, ) -> impl Iterator<Item = &mut Self>

Source

pub fn find_element_by_id(&self, id: usize) -> Option<&Self>

Source

pub fn find_element_by_id_mut(&mut self, id: usize) -> Option<&mut Self>

Source

pub fn find_element_by_str_id(&self, str_id: &str) -> Option<&Self>

Source

pub fn find_element_by_class(&self, class: &str) -> Option<&Self>

Source

pub fn find_element_by_str_id_mut(&mut self, str_id: &str) -> Option<&mut Self>

Source

pub fn find_parent<'a>(&self, root: &'a mut Self) -> Option<&'a Self>

Source

pub fn find_parent_by_id(&self, id: usize) -> Option<&Self>

Source

pub fn find_parent_by_id_mut(&mut self, id: usize) -> Option<&mut Self>

Source

pub fn find_parent_by_str_id_mut(&mut self, id: &str) -> Option<&mut Self>

Source

pub fn replace_with_elements( &mut self, replacement: Vec<Self>, root: &mut Self, ) -> Self

§Panics
  • If the Container is the root node
  • If the Container is not properly attached to the tree
Source

pub fn replace_id_children_with_elements( &mut self, replacement: Vec<Self>, id: usize, ) -> Option<Vec<Self>>

§Panics
  • If the Container is not properly attached to the tree
Source

pub fn replace_id_children_with_elements_calc( &mut self, calculator: &impl Calc, replacement: Vec<Self>, id: usize, ) -> bool

§Panics
  • If the Container is not properly attached to the tree
Source

pub fn replace_id_with_elements( &mut self, replacement: Vec<Self>, id: usize, ) -> Option<Self>

§Panics
  • If the Container is not properly attached to the tree
Source

pub fn replace_id_with_elements_calc( &mut self, calculator: &impl Calc, replacement: Vec<Self>, id: usize, ) -> bool

§Panics
  • If the Container is not properly attached to the tree
Source

pub fn replace_str_id_with_elements( &mut self, replacement: Vec<Self>, id: &str, ) -> Option<Self>

§Panics
  • If the Container is not properly attached to the tree
Source

pub fn replace_str_id_with_elements_calc( &mut self, calculator: &impl Calc, replacement: Vec<Self>, id: &str, ) -> Option<Self>

§Panics
  • If the Container is not properly attached to the tree
Source

pub fn partial_calc(&mut self, calculator: &impl Calc, id: usize)

Source§

impl Container

Source

pub fn table_iter<'a, 'b>(&'a self) -> TableIter<'b>
where 'a: 'b,

§Panics

Will panic if Element is not a table

Source

pub fn table_iter_mut<'a, 'b>(&'a mut self) -> TableIterMut<'b>
where 'a: 'b,

§Panics

Will panic if Element is not a table

Source

pub fn table_iter_mut_with_observer<'a, 'b>( &'a mut self, observer: Option<impl FnMut(&mut Self)>, ) -> TableIterMut<'b>
where 'a: 'b,

§Panics

Will panic if Element is not a table

Trait Implementations§

Source§

impl AsRef<Container> for Container

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for Container

Source§

fn clone(&self) -> Container

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Container

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Container

Source§

fn default() -> Container

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

impl Display for Container

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Container> for BfsPaths

Source§

fn from(root: &Container) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Container

Source§

fn eq(&self, other: &Container) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> TryFrom<&'a str> for Container

Source§

type Error = ParseError

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

fn try_from(value: &'a str) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<PreEscaped<String>> for Container

Source§

type Error = ParseError

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

fn try_from(value: Markup) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<String> for Container

Source§

type Error = ParseError

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

fn try_from(value: String) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl StructuralPartialEq for Container

Auto Trait Implementations§

Blanket Implementations§

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.