TreeNodeData

Struct TreeNodeData 

Source
pub struct TreeNodeData {
    pub name: String,
    pub type_str: String,
    pub node_type: NodeType,
    pub node_category: NodeCategory,
    pub config: NodeConfig,
    pub status: NodeStatus,
    pub children: Vec<TreeNode>,
    pub ports_fn: fn() -> PortsList,
}

Fields§

§name: String§type_str: String§node_type: NodeType§node_category: NodeCategory§config: NodeConfig§status: NodeStatus§children: Vec<TreeNode>

Vector of child nodes

§ports_fn: fn() -> PortsList

Implementations§

Source§

impl TreeNodeData

Source

pub async fn halt_children(&mut self, start: usize) -> NodeResult<()>

Halt children from this index to the end.

§Errors

Returns NodeError::IndexError if start is out of bounds.

Source

pub async fn reset_children(&mut self)

Halts and resets all children

Source

pub async fn halt_child_idx(&mut self, index: usize) -> NodeResult<()>

Halt child at the index. Not to be confused with halt_child(), which is a helper that calls halt_child_idx(0), primarily used for Decorator nodes.

Source

pub fn set_status(&mut self, status: NodeStatus)

Sets the status of this node

Source

pub async fn halt_child(&mut self)

Calls halt_child_idx(0). This should only be used in Decorator nodes

Source

pub async fn reset_child(&mut self)

Halts and resets the first child. This should only be used in Decorator nodes

Source

pub fn child(&mut self) -> Option<&mut TreeNode>

Gets a mutable reference to the first child. Helper for Decorator nodes to get their child.

Trait Implementations§

Source§

impl Debug for TreeNodeData

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