/// Creates a new [`OpticNode`]. The concrete type of the component must be given while using the `new` function.
/// The node type ist a struct implementing the [`Optical`] trait. Since the size of the node type is not known at compile time it must be added as `Box<nodetype>`.
///
///
/// # Examples
///
///
/// ```
/// use opossum::optic_node::OpticNode;
/// use opossum::nodes::NodeDummy;
...
...
@@ -19,7 +19,11 @@ impl OpticNode {
/// let node=OpticNode::new("My node", Box::new(NodeDummy));
/// ```
pubfnnew(name:&str,node:Box<dynOptical>)->Self{
Self{name:name.into(),node:node,inverted:false}
Self{
name:name.into(),
node:node,
inverted:false,
}
}
/// Sets the name of this [`OpticNode`].
pubfnset_name(&mutself,name:String){
...
...
@@ -29,18 +33,17 @@ impl OpticNode {
pubfnname(&self)->&str{
self.name.as_ref()
}
/// Returns a string representation of the [`OpticNode`] in `graphviz` format. This function is normally called by the top-level `to_dot`function within
/// Returns a string representation of the [`OpticNode`] in `graphviz` format. This function is normally called by the top-level `to_dot`function within