Skip to main content

NodeMeta

Struct NodeMeta 

Source
pub struct NodeMeta<Msg> {
    pub class: Option<String>,
    pub on_click: Option<Msg>,
    pub on_input: Option<OnInput<Msg>>,
    pub on_toggle: Option<OnToggle<Msg>>,
    pub ai: AiMeta,
    pub data_appfront_id: Option<u64>,
    pub is_dynamic: bool,
    pub attrs: Vec<(String, String)>,
    pub key: Option<String>,
    pub virtual_scroll: Option<VirtualScroll>,
}

Fields§

§class: Option<String>§on_click: Option<Msg>§on_input: Option<OnInput<Msg>>

See OnInput. Not serializable — a live closure can’t survive SSR/hydration JSON, and SSR/AI-schema rendering never needs to call it, only know an input exists. Currently only tpt-appfront-dom wires this into a real oninput listener; tpt-appfront-canvas/tpt-appfront-tui don’t consume it yet.

§on_toggle: Option<OnToggle<Msg>>

See OnToggle. Two-way binding for Checkbox nodes; not serializable, same reasoning as on_input.

§ai: AiMeta§data_appfront_id: Option<u64>

Stable identifier assigned before SSR so the client hydrator can match server-rendered DOM nodes back to their UITree counterpart.

§is_dynamic: bool

Whether the subtree this node roots was produced by a #[tpt_appfront_core::component] function whose body reads any Signal. false (the default) means either the node wasn’t produced by the macro, or the macro’s static analysis found no signal reads in the function body. Backends can use this as a hint to skip hydration/listener work for subtrees that never change (see Phase 9 islands hydration).

§attrs: Vec<(String, String)>

Arbitrary key/value attributes rendered verbatim by backends. Used for accessibility (role, aria-*, tabindex), semantic landmarks (aria-label, role="navigation"), and any backend-specific attribute that has no first-class NodeMeta field. Serialized as-is, so values must be String (no closures). Backends render these as DOM attributes (HTML/SSR), and ignore the ones they don’t model (canvas/TUI).

§key: Option<String>

Stable identity for reconciliation, e.g. a row/entity id. Set via NodeRef::key on items inside a NodeKind::List/NodeKind::DataGrid so backends can diff add/remove/reorder against a previous render instead of rebuilding every child from scratch.

§virtual_scroll: Option<VirtualScroll>

Windowed-rendering config for List/DataGrid nodes — see VirtualScroll. None (the default) means render every item.

Trait Implementations§

Source§

impl<Msg: Clone> Clone for NodeMeta<Msg>

Source§

fn clone(&self) -> NodeMeta<Msg>

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<Msg: Debug> Debug for NodeMeta<Msg>

Manual impl since on_input’s Rc<dyn Fn(String) -> Msg> can’t derive Debug (trait objects for Fn don’t implement it) — every other field still prints normally, on_input prints as a presence marker.

Source§

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

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

impl<Msg> Default for NodeMeta<Msg>

Source§

fn default() -> Self

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

impl<'de, Msg> Deserialize<'de> for NodeMeta<Msg>
where Msg: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Msg> Serialize for NodeMeta<Msg>
where Msg: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<Msg> !RefUnwindSafe for NodeMeta<Msg>

§

impl<Msg> !UnwindSafe for NodeMeta<Msg>

§

impl<Msg> Freeze for NodeMeta<Msg>
where Msg: Freeze,

§

impl<Msg> Send for NodeMeta<Msg>
where Msg: Send,

§

impl<Msg> Sync for NodeMeta<Msg>
where Msg: Sync,

§

impl<Msg> Unpin for NodeMeta<Msg>
where Msg: Unpin,

§

impl<Msg> UnsafeUnpin for NodeMeta<Msg>
where Msg: UnsafeUnpin,

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<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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

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