Skip to main content

DynamicNodeSpec

Struct DynamicNodeSpec 

Source
pub struct DynamicNodeSpec { /* private fields */ }
Expand description

Serializable declarative UI node tree compiled directly into native SceneTree nodes at runtime.

Implementations§

Source§

impl DynamicNodeSpec

Declarative builders and deterministic checksum helpers for DynamicNodeSpec.

Source

pub fn column() -> Self

Creates a vertical flexbox column node specification.

§Returns
  • Self - Column specification.
Source

pub fn row() -> Self

Creates a horizontal flexbox row node specification.

§Returns
  • Self - Row specification.
Source

pub fn grid(columns: u16) -> Self

Creates a grid container node specification with columns equal-width columns.

§Arguments
  • u16 - Number of grid columns.
§Returns
  • Self - Grid specification.
Source

pub fn card(title: String) -> Self

Creates a styled card surface node specification with an optional title.

§Arguments
  • String - Card heading text.
§Returns
  • Self - Card specification.
Source

pub fn text(content: String) -> Self

Creates a native text node specification.

§Arguments
  • String - UTF-8 text content.
§Returns
  • Self - Text specification.
Source

pub fn button(label: String, action: String) -> Self

Creates an interactive button node specification dispatching action when clicked.

§Arguments
  • String - Visible button label.
  • String - Action identifier emitted as DynamicActionEvent.
§Returns
  • Self - Interactive button specification.
Source

pub fn badge(label: String) -> Self

Creates a compact pill badge node specification.

§Arguments
  • String - Badge label text.
§Returns
  • Self - Badge specification.
Source

pub fn divider() -> Self

Creates a horizontal hairline divider node specification.

§Returns
  • Self - Divider specification.
Source

pub fn action_name(&self) -> Option<&str>

Returns the optional action identifier attached to this node.

§Arguments
  • &Self - Node specification reference.
§Returns
  • Option<&str> - Action identifier if interactive.
Source

pub fn child(self, child: Self) -> Self

Appends a child DynamicNodeSpec and returns self for fluent composition.

§Arguments
  • Self - Parent specification.
  • Self - Child specification to append.
§Returns
  • Self - Updated parent specification.
Source

pub fn checksum(&self) -> u64

Computes the deterministic cross-platform 64-bit FNV-1a checksum of this node tree.

§Arguments
  • &Self - Node specification reference.
§Returns
  • u64 - Deterministic checksum digest.
Source§

impl DynamicNodeSpec

Source

pub fn get_kind(&self) -> DynamicNodeKind

Source

pub fn get_mut_kind(&mut self) -> &mut DynamicNodeKind

Source

pub fn set_kind(&mut self, val: DynamicNodeKind) -> &mut Self

Source

pub fn get_text(&self) -> &String

Source

pub fn get_mut_text(&mut self) -> &mut String

Source

pub fn set_text(&mut self, val: String) -> &mut Self

Source

pub fn get_mut_action(&mut self) -> &mut Option<String>

Source

pub fn set_action(&mut self, val: Option<String>) -> &mut Self

Source

pub fn get_payload(&self) -> &String

Source

pub fn get_mut_payload(&mut self) -> &mut String

Source

pub fn set_payload(&mut self, val: String) -> &mut Self

Source

pub fn get_style(&self) -> DynamicStyleSpec

Source

pub fn get_mut_style(&mut self) -> &mut DynamicStyleSpec

Source

pub fn set_style(&mut self, val: DynamicStyleSpec) -> &mut Self

Source

pub fn get_children(&self) -> &Vec<DynamicNodeSpec>

Source

pub fn get_mut_children(&mut self) -> &mut Vec<DynamicNodeSpec>

Source

pub fn set_children(&mut self, val: Vec<DynamicNodeSpec>) -> &mut Self

Source§

impl DynamicNodeSpec

Source

pub fn new(kind: DynamicNodeKind) -> Self

Trait Implementations§

Source§

impl Clone for DynamicNodeSpec

Source§

fn clone(&self) -> Self

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 DynamicNodeSpec

Source§

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

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

impl Default for DynamicNodeSpec

Source§

fn default() -> Self

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

impl<'de> Deserialize<'de> for DynamicNodeSpec

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 PartialEq for DynamicNodeSpec

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DynamicNodeSpec

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

impl StructuralPartialEq for DynamicNodeSpec

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<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 = !

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.