#[repr(C)]pub struct Node { /* private fields */ }Implementations§
Source§impl Node
impl Node
pub fn new() -> Self
pub fn new_typed(node_type: NodeType) -> Self
pub fn new_ptr() -> NodePtr
pub unsafe fn parent<'a>(&self) -> Option<&'a Node>
pub fn set_parent(&self, parent: Option<NodePtr>)
pub fn parent_ptr(&self) -> Option<NodePtr>
pub unsafe fn children(&self) -> Vec<&Node>
pub fn children_len(&self) -> usize
pub unsafe fn set_node_type(&self, node_type: NodeType)
pub unsafe fn set_baseline_func( &self, baseline_func: Option<Box<dyn Fn(NodePtr, Len, Len) -> Len>>, )
pub unsafe fn has_baseline_func(&self) -> bool
pub fn set_measure_func( &self, measure_func: Option<Box<dyn Fn(NodePtr, Len, MeasureMode, Len, MeasureMode, Len, Len, Len, Len) -> Size<Len>>>, )
pub fn has_measure_func(&self) -> bool
pub fn set_resolve_calc( &self, resolve_calc: Option<Box<dyn Fn(i32, Len) -> Len>>, )
pub fn set_dirty_callback(&self, dirty_callback: Option<Box<dyn Fn(NodePtr)>>)
pub fn has_dirty_callback(&self) -> bool
pub fn external_host(&self) -> Option<ExternalHostPtr>
pub fn set_external_host(&self, external_host: Option<ExternalHostPtr>)
pub unsafe fn mark_self_dirty(&self)
pub unsafe fn mark_dirty_propagate_to_descendants(&self)
pub unsafe fn mark_dirty_propagate(&self)
pub fn dry_layout( &self, available_size: OptionSize<Len>, viewport_size: Size<Len>, )
pub unsafe fn layout( &self, available_size: OptionSize<Len>, viewport_size: Size<Len>, )
pub unsafe fn layout_with_containing_size( &self, available_size: OptionSize<Len>, viewport_size: Size<Len>, containing_size: OptionSize<Len>, )
pub fn layout_position(&self) -> LayoutPosition
Trait Implementations§
Source§impl ChildOperation for Node
impl ChildOperation for Node
unsafe fn get_child_at(&self, idx: usize) -> Option<&Node>
unsafe fn get_child_ptr_at(&self, idx: usize) -> Option<NodePtr>
unsafe fn get_child_index(&self, child: NodePtr) -> Option<usize>
unsafe fn append_child(&self, child: NodePtr)
unsafe fn insert_child_at(&self, child: NodePtr, idx: usize)
unsafe fn insert_child_before(&self, child: NodePtr, pivot: NodePtr)
unsafe fn remove_child(&self, child: NodePtr)
unsafe fn remove_child_at(&self, idx: usize)
unsafe fn remove_all_children(&self)
unsafe fn for_each_child_node<'a, 'b: 'a, F>(&'b self, func: F)
Source§impl DumpNode for Node
impl DumpNode for Node
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
impl LayoutStyle<FixedI32<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>> for Node
fn display(&self) -> Display
fn position(&self) -> Position
fn box_sizing(&self) -> BoxSizing
fn direction(&self) -> Direction
fn writing_mode(&self) -> WritingMode
fn flex_direction(&self) -> FlexDirection
fn flex_wrap(&self) -> FlexWrap
fn flex_grow(&self) -> f32
fn flex_shrink(&self) -> f32
fn align_items(&self) -> AlignItems
fn align_self(&self) -> AlignSelf
fn align_content(&self) -> AlignContent
fn justify_content(&self) -> JustifyContent
fn left(&self) -> Length
fn right(&self) -> Length
fn top(&self) -> Length
fn bottom(&self) -> Length
fn border_left(&self) -> Length
fn border_right(&self) -> Length
fn border_top(&self) -> Length
fn border_bottom(&self) -> Length
fn margin_left(&self) -> Length
fn margin_right(&self) -> Length
fn margin_top(&self) -> Length
fn margin_bottom(&self) -> Length
fn padding_left(&self) -> Length
fn padding_right(&self) -> Length
fn padding_top(&self) -> Length
fn padding_bottom(&self) -> Length
fn flex_basis(&self) -> Length
fn width(&self) -> Length
fn height(&self) -> Length
fn min_width(&self) -> Length
fn min_height(&self) -> Length
fn max_width(&self) -> Length
fn max_height(&self) -> Length
fn aspect_ratio(&self) -> Option<f32>
fn order(&self) -> i32
fn text_align(&self) -> TextAlign
fn row_gap(&self) -> Length
fn column_gap(&self) -> Length
Source§impl LayoutTreeNode for Node
impl LayoutTreeNode for Node
Source§type Length = FixedI32<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>
type Length = FixedI32<UInt<UInt<UInt<UInt<UTerm, B1>, B0>, B1>, B0>>
The main length type. Read more
Source§type LengthCustom = i32
type LengthCustom = i32
A custem length type used in
DefLength::Custom. Read moreSource§type TreeVisitor = Node
type TreeVisitor = Node
A helper type for tree traversal. Read more
Source§type InlineUnit = LayoutInlineUnit
type InlineUnit = LayoutInlineUnit
A helper type to represent the current node as an inline node. Read more
Source§type InlineMeasure = LayoutInlineMeasure
type InlineMeasure = LayoutInlineMeasure
A helper type to measure inline node. Read more
Source§fn layout_node(&self) -> &LayoutNode<Self>
fn layout_node(&self) -> &LayoutNode<Self>
Get a reference to the
LayoutNode of the current tree node.Source§fn tree_visitor(&self) -> &Self::TreeVisitor
fn tree_visitor(&self) -> &Self::TreeVisitor
Get a helper for tree traversal.
Source§fn resolve_custom_length(
&self,
custom: &Self::LengthCustom,
owner: Self::Length,
) -> Self::Length
fn resolve_custom_length( &self, custom: &Self::LengthCustom, owner: Self::Length, ) -> Self::Length
Resolve a
Length::Custom value. Read moreSource§fn should_measure(&self, _env: &mut Self::Env) -> bool
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,
) -> MeasureResult<Self::Length>
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, ) -> 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>,
) -> Self::InlineUnit
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>, ) -> Self::InlineUnit
Convert the current node to a
Self::InlineUnit. Read moreSource§fn size_updated(
&self,
_env: &mut Self::Env,
_size: Size2D<Self::Length, UnknownUnit>,
_computed_style: &ComputedStyle<Self::Length>,
)
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
impl LayoutTreeVisitor<Node> for Node
Source§fn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
fn for_each_child<'a, 'b: 'a, F>(&'b self, f: F)
Get child nodes.
Source§fn children_len(&self) -> usize
fn children_len(&self) -> usize
Get the count of child nodes.
Source§fn dirty_marked(&self)
fn dirty_marked(&self)
A notifier that the node has been marked dirty. Read more
Source§impl StyleSetter for Node
impl StyleSetter for Node
unsafe fn set_flex_direction(&self, flex_direction: FlexDirection)
unsafe fn set_direction(&self, direction: Direction)
unsafe fn set_align_content(&self, align_content: AlignContent)
unsafe fn set_align_items(&self, align_items: AlignItems)
unsafe fn set_align_self(&self, align_self: AlignSelf)
unsafe fn set_aspect_ratio(&self, aspect_ratio: Option<f32>)
unsafe fn set_border(&self, border: Length)
unsafe fn set_border_left(&self, border_left: Length)
unsafe fn set_border_right(&self, border_right: Length)
unsafe fn set_border_top(&self, border_top: Length)
unsafe fn set_border_bottom(&self, border_bottom: Length)
unsafe fn set_box_sizing(&self, box_sizing: BoxSizing)
unsafe fn set_display(&self, display: Display)
unsafe fn set_height(&self, height: Length)
unsafe fn set_width(&self, width: Length)
unsafe fn set_left(&self, left: Length)
unsafe fn set_right(&self, right: Length)
unsafe fn set_top(&self, top: Length)
unsafe fn set_bottom(&self, bottom: Length)
unsafe fn set_flex_shrink(&self, flex_shrink: f32)
unsafe fn set_flex_grow(&self, flex_grow: f32)
unsafe fn set_flex_wrap(&self, flex_wrap: FlexWrap)
unsafe fn set_flex_basis(&self, flex_basis: Length)
unsafe fn set_justify_content(&self, justify_content: JustifyContent)
unsafe fn set_position(&self, position: Position)
unsafe fn set_overflow_x(&self, overflow_x: Overflow)
unsafe fn set_overflow_y(&self, overflow_y: Overflow)
unsafe fn set_writing_mode(&self, writing_mode: WritingMode)
unsafe fn set_margin(&self, margin: Length)
unsafe fn set_margin_bottom(&self, margin_bottom: Length)
unsafe fn set_margin_left(&self, margin_left: Length)
unsafe fn set_margin_right(&self, margin_right: Length)
unsafe fn set_margin_top(&self, margin_top: Length)
unsafe fn set_max_height(&self, max_height: Length)
unsafe fn set_max_width(&self, max_width: Length)
unsafe fn set_min_height(&self, min_height: Length)
unsafe fn set_min_width(&self, min_width: Length)
unsafe fn set_padding(&self, padding: Length)
unsafe fn set_padding_left(&self, padding_left: Length)
unsafe fn set_padding_right(&self, padding_right: Length)
unsafe fn set_padding_top(&self, padding_top: Length)
unsafe fn set_padding_bottom(&self, padding_bottom: Length)
unsafe fn set_order(&self, order: i32)
unsafe fn set_text_align(&self, text_align: TextAlign)
unsafe fn set_row_gap(&self, value: Length)
unsafe fn set_column_gap(&self, value: Length)
Auto Trait Implementations§
impl !Freeze for Node
impl !RefUnwindSafe for Node
impl !Send for Node
impl !Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.