Skip to main content

DivNode

Struct DivNode 

Source
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: u8

Implementations§

Source§

impl<'a> DivNode<'a>

Source

pub fn text_color(&self) -> Option<Color>

Source

pub fn text_size(&self) -> Option<u8>

Source

pub fn hover_style(&self) -> Option<StyleRefinement>

Source

pub fn active_style(&self) -> Option<StyleRefinement>

Source

pub fn focus_style(&self) -> Option<StyleRefinement>

Source

pub const fn id(&self) -> Option<u32>

Source

pub const fn active_bg(&self) -> Option<Color>

Source

pub const fn hover_bg(&self) -> Option<Color>

Source

pub const fn focusable(&self) -> bool

Source

pub const fn is_overlay(&self) -> bool

Source

pub const fn occlude_hit(&self) -> bool

Source

pub const fn auto_repeat(&self) -> bool

Source

pub const fn clip_children(&self) -> bool

Source

pub fn on_click(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>

Source

pub fn on_long_press(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>

Source

pub fn on_drag(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>

Source

pub fn on_swipe(&self) -> Option<&'a dyn Fn(SwipeDir, &mut ActionScope<'_>)>

Source

pub fn on_key_input(&self) -> Option<&'a dyn Fn(KeyCode, &mut ActionScope<'_>)>

Source

pub fn on_key_nav(&self) -> Option<&'a dyn Fn(KeyCode, &mut ActionScope<'_>)>

Source

pub fn on_navigate_back(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>

Source

pub fn on_secondary_click(&self) -> Option<&'a dyn Fn(&mut ActionScope<'_>)>

Methods from Deref<Target = DivVisual<'a>>§

Source

pub fn pos(&self) -> Option<(i16, i16)>

Source

pub fn scrollable_max(&self) -> Option<i16>

Source

pub fn bg_grad(&self) -> Option<(Color, bool)>

Source

pub fn focus_border(&self) -> Option<(u8, Color)>

Source

pub fn shadow(&self) -> Option<(u8, i8, i8, Color)>

Source

pub fn items_baseline(&self) -> bool

Source

pub fn align_self(&self) -> Option<AlignItems>

Source

pub fn transition_spec(&self) -> Option<TransitionSpec>

Trait Implementations§

Source§

impl<'a> Deref for DivNode<'a>

Source§

type Target = DivVisual<'a>

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.

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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> FluentBuilder for T

Source§

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

根据 condition 在两个修饰分支之间二选一。
Source§

fn when_some<O>( self, option: Option<O>, then: impl FnOnce(Self, O) -> Self, ) -> Self

当 option 为 Some(value) 时执行闭包修饰自身,否则原样返回。
Source§

fn when_none<O>( self, option: &Option<O>, then: impl FnOnce(Self) -> Self, ) -> Self

当 option 为 None 时执行闭包修饰自身,否则原样返回。
Source§

fn apply<U>(self, f: impl FnOnce(Self) -> U) -> U

通用管道映射变换(避免与 Iterator::map / Option::map 重名)。
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.