Skip to main content

TreeNode

Struct TreeNode 

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

A node in the Ember+ tree.

Implementations§

Source§

impl TreeNode

Source

pub fn new_node(number: i32) -> Self

Create a new container node.

Source

pub fn new_parameter(number: i32, value: EmberValue) -> Self

Create a new parameter node.

Source

pub fn number(&self) -> i32

Get the node number.

Source

pub fn contents(&self) -> &NodeContents

Get the node contents.

Source

pub fn contents_mut(&mut self) -> &mut NodeContents

Get mutable node contents.

Source

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

Get the identifier.

Source

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

Get the description.

Source

pub fn is_node(&self) -> bool

Check if this is a container node.

Source

pub fn is_parameter(&self) -> bool

Check if this is a parameter.

Source

pub fn is_function(&self) -> bool

Check if this is a function.

Source

pub fn is_matrix(&self) -> bool

Check if this is a matrix.

Source

pub fn value(&self) -> Option<&EmberValue>

Get the parameter value if this is a parameter.

Source

pub fn set_value(&mut self, new_value: EmberValue)

Set the parameter value.

Source

pub fn add_child(&mut self, child: TreeNodeRef)

Add a child node.

Source

pub fn get_child(&self, number: i32) -> Option<TreeNodeRef>

Get a child by number.

Source

pub fn children(&self) -> impl Iterator<Item = &TreeNodeRef>

Get all children.

Source

pub fn update_from_glow_node(&mut self, glow: &GlowNode)

Update from a Glow node.

Source

pub fn update_from_glow_parameter(&mut self, glow: &GlowParameter)

Update from a Glow parameter.

Source

pub fn update_from_glow_function(&mut self, glow: &GlowFunction)

Update from a Glow function.

Source

pub fn update_from_glow_matrix(&mut self, glow: &GlowMatrix)

Update from a Glow matrix.

Source

pub fn to_glow_element(&self) -> GlowElement

Convert to a Glow element (non-qualified, for nested children).

Source

pub fn to_qualified_glow_element(&self, path: &EmberPath) -> GlowElement

Convert to a qualified Glow element with full path. This is the correct format for server responses.

Trait Implementations§

Source§

impl Debug for TreeNode

Source§

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

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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