Skip to main content

Node

Struct Node 

Source
pub struct Node { /* private fields */ }

Implementations§

Source§

impl Node

Source

pub fn new() -> Self

Source

pub fn new_typed(node_type: NodeType) -> Self

Source

pub fn new_ptr() -> NodePtr

Source

pub unsafe fn parent<'a>(&self) -> Option<&'a Node>

Source

pub fn set_parent(&self, parent: Option<NodePtr>)

Source

pub fn parent_ptr(&self) -> Option<NodePtr>

Source

pub unsafe fn children(&self) -> Vec<&Node>

Source

pub fn children_len(&self) -> usize

Source

pub unsafe fn set_node_type(&self, node_type: NodeType)

Source

pub fn set_baseline_func( &self, baseline_func: Option<Box<dyn Fn(NodePtr, Len, Len) -> Len>>, )

Source

pub unsafe fn has_baseline_func(&self) -> bool

Source

pub fn set_measure_func( &self, measure_func: Option<Box<dyn Fn(NodePtr, Len, MeasureMode, Len, MeasureMode, Len, Len, Len, Len) -> Size<Len>>>, )

Source

pub fn has_measure_func(&self) -> bool

Source

pub fn set_resolve_calc( &self, resolve_calc: Option<Box<dyn Fn(i32, Len) -> Len>>, )

Source

pub fn set_dirty_callback(&self, dirty_callback: Option<Box<dyn Fn(NodePtr)>>)

Source

pub fn has_dirty_callback(&self) -> bool

Source

pub fn external_host(&self) -> Option<ExternalHostPtr>

Source

pub fn set_external_host(&self, external_host: Option<ExternalHostPtr>)

Source

pub unsafe fn mark_self_dirty(&self)

Source

pub unsafe fn mark_dirty_propagate_to_descendants(&self)

Source

pub unsafe fn mark_dirty_propagate(&self)

Source

pub fn dry_layout( &self, available_size: OptionSize<Len>, viewport_size: Size<Len>, )

Source

pub unsafe fn layout( &self, available_size: OptionSize<Len>, viewport_size: Size<Len>, )

Source

pub unsafe fn layout_with_containing_size( &self, available_size: OptionSize<Len>, viewport_size: Size<Len>, containing_size: OptionSize<Len>, )

Source

pub fn layout_position(&self) -> LayoutPosition

Trait Implementations§

Source§

impl ChildOperation for Node

Source§

unsafe fn get_child_at(&self, idx: usize) -> Option<&Node>

Source§

unsafe fn get_child_ptr_at(&self, idx: usize) -> Option<NodePtr>

Source§

unsafe fn get_child_index(&self, child: NodePtr) -> Option<usize>

Source§

unsafe fn append_child(&self, child: NodePtr)

Source§

unsafe fn insert_child_at(&self, child: NodePtr, idx: usize)

Source§

unsafe fn insert_child_before(&self, child: NodePtr, pivot: NodePtr)

Source§

unsafe fn remove_child(&self, child: NodePtr)

Source§

unsafe fn remove_child_at(&self, idx: usize)

Source§

unsafe fn remove_all_children(&self)

Source§

unsafe fn for_each_child_node<'a, 'b: 'a, F>(&'b self, func: F)
where F: FnMut(&'a Self, usize),

Source§

impl Debug for Node

Source§

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

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

impl Default for Node

Source§

fn default() -> Self

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

impl DumpNode for Node

Source§

unsafe fn dump_to_html(&self, options: DumpOptions, current_depth: u8) -> String

Source§

impl LayoutStyle<FixedI32<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>> for Node

Source§

fn display(&self) -> Display

Source§

fn position(&self) -> Position

Source§

fn box_sizing(&self) -> BoxSizing

Source§

fn direction(&self) -> Direction

Source§

fn writing_mode(&self) -> WritingMode

Source§

fn flex_direction(&self) -> FlexDirection

Source§

fn flex_wrap(&self) -> FlexWrap

Source§

fn flex_grow(&self) -> f32

Source§

fn flex_shrink(&self) -> f32

Source§

fn align_items(&self) -> AlignItems

Source§

fn align_self(&self) -> AlignSelf

Source§

fn align_content(&self) -> AlignContent

Source§

fn justify_content(&self) -> JustifyContent

Source§

fn left(&self) -> Length

Source§

fn right(&self) -> Length

Source§

fn top(&self) -> Length

Source§

fn bottom(&self) -> Length

Source§

fn border_left(&self) -> Length

Source§

fn border_right(&self) -> Length

Source§

fn border_top(&self) -> Length

Source§

fn border_bottom(&self) -> Length

Source§

fn margin_left(&self) -> Length

Source§

fn margin_right(&self) -> Length

Source§

fn margin_top(&self) -> Length

Source§

fn margin_bottom(&self) -> Length

Source§

fn padding_left(&self) -> Length

Source§

fn padding_right(&self) -> Length

Source§

fn padding_top(&self) -> Length

Source§

fn padding_bottom(&self) -> Length

Source§

fn flex_basis(&self) -> Length

Source§

fn width(&self) -> Length

Source§

fn height(&self) -> Length

Source§

fn min_width(&self) -> Length

Source§

fn min_height(&self) -> Length

Source§

fn max_width(&self) -> Length

Source§

fn max_height(&self) -> Length

Source§

fn aspect_ratio(&self) -> Option<f32>

Source§

fn order(&self) -> i32

Source§

fn text_align(&self) -> TextAlign

Source§

fn row_gap(&self) -> Length

Source§

fn column_gap(&self) -> Length

Source§

fn grid_template_rows(&self) -> LayoutGridTemplate

Source§

fn grid_template_columns(&self) -> LayoutGridTemplate

Source§

fn grid_auto_flow(&self) -> GridAutoFlow

Source§

fn grid_auto_rows(&self) -> LayoutGridAuto

CSS Grid §7.6: grid-auto-rows https://www.w3.org/TR/css-grid-1/#auto-tracks
Source§

fn grid_auto_columns(&self) -> LayoutGridAuto

CSS Grid §7.6: grid-auto-columns https://www.w3.org/TR/css-grid-1/#auto-tracks
Source§

fn justify_items(&self) -> JustifyItems

Source§

fn justify_self(&self) -> JustifySelf

Source§

impl LayoutTreeNode for Node

Source§

type Length = FixedI32<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>

The main length type. Read more
Source§

type LengthCustom = i32

A custom length type used in DefLength::Custom. Read more
Source§

type TreeVisitor = Node

A helper type for tree traversal. Read more
Source§

type Style = Node

The layout styles of the current node.
Source§

type InlineUnit = LayoutInlineUnit

A helper type to represent the current node as an inline node. Read more
Source§

type InlineMeasure = LayoutInlineMeasure

A helper type to measure inline node. Read more
Source§

type Env = Env

Some custom environment data.
Source§

fn layout_node(&self) -> &LayoutNode<Self>

Get a reference to the LayoutNode of the current tree node.
Source§

fn tree_visitor(&self) -> &Self::TreeVisitor

Get a helper for tree traversal.
Source§

fn style(&self) -> &Self::Style

Get the styles of the current tree node.
Source§

fn resolve_custom_length( &self, custom: &Self::LengthCustom, owner: Self::Length, ) -> Self::Length

Resolve a Length::Custom value. Read more
Source§

fn should_measure(&self, _env: &mut Self::Env) -> bool

Returns if the node is a “measure” node. Read more
Source§

fn measure_block_size( &self, _env: &mut Self::Env, req_size: OptionSize<Self::Length>, min: Size<Self::Length>, max: Size<Self::Length>, max_content: OptionSize<Self::Length>, _update_position: bool, _sizing_mode: SizingMode, ) -> MeasureResult<Self::Length>

Measure a size for the current tree node. Read more
Source§

fn measure_inline_unit( &self, env: &mut Self::Env, req_size: OptionSize<Self::Length>, min: Size<Self::Length>, max: Size<Self::Length>, max_content: OptionSize<Self::Length>, sizing_mode: SizingMode, ) -> MeasureResult<Self::Length>

Convert the current node to a Self::InlineUnit. Read more
Source§

fn size_updated( &self, _env: &mut Self::Env, _size: Size2D<Self::Length, UnknownUnit>, _computed_style: &ComputedStyle<Self::Length>, )

A notifier that the layout size of itself (or any node in the subtree) has been re-evaluated. Read more
Source§

impl LayoutTreeVisitor<Node> for Node

Source§

fn parent(&self) -> Option<&Node>

Get the parent node.
Source§

fn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
where F: FnMut(&'a Node, usize), Node: 'a,

Get child nodes.
Source§

fn children_len(&self) -> usize

Get the count of child nodes.
Source§

fn child_at(&self, index: usize) -> Option<&Node>

Get the specified child.
Source§

fn children_iter<'a, 'b: 'a>(&'b self) -> impl Iterator<Item = &'a Node>
where Node: 'a,

Get children iterator.
Source§

fn dirty_marked(&self)

A notifier that the node has been marked dirty. Read more
Source§

impl StyleSetter for Node

Source§

unsafe fn set_flex_direction(&self, flex_direction: FlexDirection)

Source§

unsafe fn set_direction(&self, direction: Direction)

Source§

unsafe fn set_align_content(&self, align_content: AlignContent)

Source§

unsafe fn set_align_items(&self, align_items: AlignItems)

Source§

unsafe fn set_align_self(&self, align_self: AlignSelf)

Source§

unsafe fn set_justify_items(&self, justify_items: JustifyItems)

Source§

unsafe fn set_justify_self(&self, justify_self: JustifySelf)

Source§

unsafe fn set_aspect_ratio(&self, aspect_ratio: Option<f32>)

Source§

unsafe fn set_border(&self, border: Length)

Source§

unsafe fn set_border_left(&self, border_left: Length)

Source§

unsafe fn set_border_right(&self, border_right: Length)

Source§

unsafe fn set_border_top(&self, border_top: Length)

Source§

unsafe fn set_border_bottom(&self, border_bottom: Length)

Source§

unsafe fn set_box_sizing(&self, box_sizing: BoxSizing)

Source§

unsafe fn set_display(&self, display: Display)

Source§

unsafe fn set_height(&self, height: Length)

Source§

unsafe fn set_width(&self, width: Length)

Source§

unsafe fn set_left(&self, left: Length)

Source§

unsafe fn set_right(&self, right: Length)

Source§

unsafe fn set_top(&self, top: Length)

Source§

unsafe fn set_bottom(&self, bottom: Length)

Source§

unsafe fn set_flex_shrink(&self, flex_shrink: f32)

Source§

unsafe fn set_flex_grow(&self, flex_grow: f32)

Source§

unsafe fn set_flex_wrap(&self, flex_wrap: FlexWrap)

Source§

unsafe fn set_flex_basis(&self, flex_basis: Length)

Source§

unsafe fn set_justify_content(&self, justify_content: JustifyContent)

Source§

unsafe fn set_position(&self, position: Position)

Source§

unsafe fn set_overflow_x(&self, overflow_x: Overflow)

Source§

unsafe fn set_overflow_y(&self, overflow_y: Overflow)

Source§

unsafe fn set_writing_mode(&self, writing_mode: WritingMode)

Source§

unsafe fn set_margin(&self, margin: Length)

Source§

unsafe fn set_margin_bottom(&self, margin_bottom: Length)

Source§

unsafe fn set_margin_left(&self, margin_left: Length)

Source§

unsafe fn set_margin_right(&self, margin_right: Length)

Source§

unsafe fn set_margin_top(&self, margin_top: Length)

Source§

unsafe fn set_max_height(&self, max_height: Length)

Source§

unsafe fn set_max_width(&self, max_width: Length)

Source§

unsafe fn set_min_height(&self, min_height: Length)

Source§

unsafe fn set_min_width(&self, min_width: Length)

Source§

unsafe fn set_padding(&self, padding: Length)

Source§

unsafe fn set_padding_left(&self, padding_left: Length)

Source§

unsafe fn set_padding_right(&self, padding_right: Length)

Source§

unsafe fn set_padding_top(&self, padding_top: Length)

Source§

unsafe fn set_padding_bottom(&self, padding_bottom: Length)

Source§

unsafe fn set_order(&self, order: i32)

Source§

unsafe fn set_text_align(&self, text_align: TextAlign)

Source§

unsafe fn set_row_gap(&self, value: Length)

Source§

unsafe fn set_column_gap(&self, value: Length)

Source§

unsafe fn set_grid_template_rows(&self, value: LayoutGridTemplate)

Source§

unsafe fn set_grid_template_columns(&self, value: LayoutGridTemplate)

Source§

unsafe fn set_grid_auto_flow(&self, value: GridAutoFlow)

Source§

unsafe fn set_grid_auto_rows(&self, value: LayoutGridAuto)

Source§

unsafe fn set_grid_auto_columns(&self, value: LayoutGridAuto)

Auto Trait Implementations§

§

impl !Freeze for Node

§

impl !RefUnwindSafe for Node

§

impl !Send for Node

§

impl !Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl !UnwindSafe for Node

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> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
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<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
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<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
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> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.