pub struct DivNode<'a> {
pub style: Style,
pub first_child: Option<&'a ElementNode<'a>>,
pub visual: Option<&'a DivVisual<'a>>,
pub interact: Option<&'a DivInteractivity<'a>>,
pub raw_id: u32,
pub raw_active_bg: Color,
pub raw_hover_bg: Color,
pub opacity: u8,
pub z_index: i8,
pub grid_cols: u8,
pub flags: u8,
}Expand description
存储在 super::Element::Div 中的紧凑容器节点(固定 64 Bytes,将 ElementNode 压缩至 72B)。
Fields§
§style: Style§first_child: Option<&'a ElementNode<'a>>§visual: Option<&'a DivVisual<'a>>§interact: Option<&'a DivInteractivity<'a>>§raw_id: u32§raw_active_bg: Color§raw_hover_bg: Color§opacity: u8§z_index: i8§grid_cols: u8§flags: u8Implementations§
Source§impl<'a> DivNode<'a>
impl<'a> DivNode<'a>
pub fn state_styles(&self) -> Option<&'a DivStateStyles<'a>>
pub fn effects(&self) -> Option<&'a PaintEffects<'a>>
pub fn text_color(&self) -> Option<Color>
pub fn text_size(&self) -> Option<u8>
pub fn hover_style(&self) -> Option<StyleRefinement>
pub fn active_style(&self) -> Option<StyleRefinement>
pub fn focus_style(&self) -> Option<StyleRefinement>
pub const fn id(&self) -> Option<u32>
pub const fn active_bg(&self) -> Option<Color>
pub const fn hover_bg(&self) -> Option<Color>
pub const fn focusable(&self) -> bool
pub const fn is_overlay(&self) -> bool
pub const fn occlude_hit(&self) -> bool
pub const fn auto_repeat(&self) -> bool
pub const fn clip_children(&self) -> bool
pub fn on_click(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>
pub fn on_long_press(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>
pub fn on_drag(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>
pub fn on_swipe(&self) -> Option<&'a dyn Fn(SwipeDir, &mut ActionScope<'_>)>
pub fn on_key_input(&self) -> Option<&'a dyn Fn(KeyCode, &mut ActionScope<'_>)>
pub fn on_secondary_click(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>
Methods from Deref<Target = DivVisual<'a>>§
pub fn pos(&self) -> Option<(i16, i16)>
pub fn scrollable_max(&self) -> Option<i16>
pub fn bg_grad(&self) -> Option<(Color, bool)>
pub fn focus_border(&self) -> Option<(u8, Color)>
pub fn shadow(&self) -> Option<(u8, i8, i8, Color)>
pub fn items_baseline(&self) -> bool
pub fn align_self(&self) -> Option<AlignItems>
pub fn transition_spec(&self) -> Option<TransitionSpec>
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DivNode<'a>
impl<'a> !Send for DivNode<'a>
impl<'a> !Sync for DivNode<'a>
impl<'a> !UnwindSafe for DivNode<'a>
impl<'a> Forget for DivNode<'a>
impl<'a> Freeze for DivNode<'a>
impl<'a> Move for DivNode<'a>
impl<'a> Unpin for DivNode<'a>
impl<'a> UnsafeUnpin for DivNode<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FluentBuilder for T
impl<T> FluentBuilder for T
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Self
当
condition 为 true 时执行闭包修饰自身,否则原样返回。Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Self
fn when_else( self, condition: bool, then: impl FnOnce(Self) -> Self, else_fn: impl FnOnce(Self) -> Self, ) -> Self
根据
condition 在两个修饰分支之间二选一。Source§fn when_some<O>(
self,
option: Option<O>,
then: impl FnOnce(Self, O) -> Self,
) -> Self
fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self
当
option 为 Some(value) 时执行闭包修饰自身,否则原样返回。