Skip to main content

NodeInfo

Struct NodeInfo 

Source
pub struct NodeInfo {
Show 34 fields pub key: Key, pub parent: Option<Key>, pub depth: u16, pub kind: NodeKind, pub label: Option<String>, pub rect: Rect, pub dir: Dir, pub width: Sizing, pub height: Sizing, pub bg: Color, pub float: bool, pub role: Option<Role>, pub text: Option<String>, pub flags: Vec<&'static str>, pub layer: u16, pub origin: OriginId, pub children: u32, pub padding: Edges, pub gap: f32, pub main_align: Align, pub cross_align: Align, pub wrap: bool, pub table: bool, pub min_w: Option<f32>, pub min_h: Option<f32>, pub max_w: Option<f32>, pub max_h: Option<f32>, pub radius: [f32; 4], pub border_w: f32, pub border_color: Color, pub opacity: f32, pub backdrop_blur: f32, pub scroll: Option<Vec2>, pub events: Vec<(&'static str, Value)>,
}
Expand description

One node of the last finished frame.

Fields§

§key: Key§parent: Option<Key>§depth: u16

Nesting depth; the root is 0.

§kind: NodeKind§label: Option<String>

The label it was opened under, when it was opened by one.

§rect: Rect

Where layout put it, logical px — the host’s viewport through Core::nodes, the window’s in the snapshot the panel reads.

§dir: Dir§width: Sizing§height: Sizing§bg: Color§float: bool§role: Option<Role>

The role the access tree reads for it — declared, or derived from what it is and does (a box with a click is a button). Plain structure has none.

§text: Option<String>

A text node’s content, cut to a line’s worth.

§flags: Vec<&'static str>

The declarations that make it interactive or special, by name: click, drag, key, hover, hoverable, context-menu, modal, selectable, focusable, disabled, scroll, clip, transition.

§layer: u16

The paint layer it is in: 0 in flow, else the rank of its float layer from the bottom, 1 being the first layer over the flow. What decides which of two nodes under one point is on top.

§origin: OriginId

Who declared it: the host, an extension, or the devtools.

§children: u32

How many children it has.

§padding: Edges

The rest of the layout spec, for the inspector.

§gap: f32§main_align: Align§cross_align: Align§wrap: bool§table: bool

Whether it is a table (LayoutSpec::table): a column whose rows’ cells line up.

§min_w: Option<f32>

The size floors and ceilings, as layout left them: a floor is the declared px, or the number a fit floor resolved to in the fit pass (the pass writes it back into the spec, so a declared "fit" reads as its measurement here, not as the word); None only for a fit floor the pass never measured. A ceiling is None when unbounded.

§min_h: Option<f32>§max_w: Option<f32>§max_h: Option<f32>§radius: [f32; 4]

The rest of the paint spec.

§border_w: f32§border_color: Color§opacity: f32§backdrop_blur: f32

Its backdrop_blur radius in logical px, 0 for none (backlog F129).

§scroll: Option<Vec2>

A scroller’s offset, None for a node that does not scroll.

§events: Vec<(&'static str, Value)>

Every handler it declared, with the payload it would post: click, drag, key (the sink’s tag), hover, context-menu, force-click, layout, modal.

Implementations§

Source§

impl NodeInfo

Source

pub fn to_value(&self, h: Handles) -> Value

The row as plain data, every field under its snake_case name — the key and parent spelled by h, sizing as Sizing::describe, colours as hex, enums by their schema names, events a map of handler name to payload.

Trait Implementations§

Source§

impl Clone for NodeInfo

Source§

fn clone(&self) -> NodeInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for NodeInfo

Source§

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

Formats the value using the given formatter. Read more

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<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> 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> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
Source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
Source§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
Source§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> DowncastSync for T
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more