pub struct HierarchyNode<T: Node> {
    pub root: Box<T>,
    pub children: Vec<Box<dyn Node>>,
    pub associated: Option<Box<dyn BuildAssociated<T>>>,
    pub associated_data: HashMap<&'static str, AssociatedData>,
}
Expand description

Contains a root node, apart from its children. Simulates a hierarchy.

Fields§

§root: Box<T>§children: Vec<Box<dyn Node>>§associated: Option<Box<dyn BuildAssociated<T>>>§associated_data: HashMap<&'static str, AssociatedData>

Implementations§

source§

impl<T: Node> HierarchyNode<T>

source

pub fn new(root: T) -> Self

source

pub fn push_child<U: Node + 'static>(&mut self, node: U)

source

pub fn extend_boxed<Iter: IntoIterator<Item = Box<dyn Node>>>( &mut self, nodes: Iter )

source

pub fn extend_children<U: Node + 'static, Iter: IntoIterator<Item = U>>( &mut self, nodes: Iter )

source

pub fn set_associated<U: BuildAssociated<T> + 'static>(&mut self, associated: U)

source

pub fn insert_data<U: Into<AssociatedData>>( &mut self, key: &'static str, data: U )

source

pub fn get_data(&self, key: &'static str) -> Option<&AssociatedData>

Trait Implementations§

source§

impl<T: Debug + Node> Debug for HierarchyNode<T>

source§

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

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

impl From<HierarchyNode<<Bundle as Displayed>::Node>> for AnyExprNode

source§

fn from(value: HierarchyNode<<Bundle as Displayed>::Node>) -> Self

Converts to this type from the input type.
source§

impl From<HierarchyNode<<Point as Displayed>::Node>> for AnyExprNode

source§

fn from(value: HierarchyNode<<Point as Displayed>::Node>) -> Self

Converts to this type from the input type.
source§

impl From<HierarchyNode<<PointCollection as Displayed>::Node>> for AnyExprNode

source§

fn from(value: HierarchyNode<<PointCollection as Displayed>::Node>) -> Self

Converts to this type from the input type.
source§

impl<T: Node> Node for HierarchyNode<T>

source§

fn get_display(&self) -> bool

source§

fn set_display(&mut self, display: bool)

source§

fn build(self: Box<Self>, compiler: &mut Compiler, figure: &mut Figure)

source§

fn build_unboxed(self, compiler: &mut Compiler, figure: &mut Figure)
where Self: Sized,

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for HierarchyNode<T>

§

impl<T> !Send for HierarchyNode<T>

§

impl<T> !Sync for HierarchyNode<T>

§

impl<T> Unpin for HierarchyNode<T>

§

impl<T> !UnwindSafe for HierarchyNode<T>

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

source§

fn convert<U>(self, context: &CompileContext) -> Expr<U>
where U: ConvertFrom<T>,

Errors Read more
source§

fn can_convert<U>(&self) -> bool
where U: ConvertFrom<T>,

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

§

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

§

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V