fn visualize<F>(&self, annotate: &F) -> Option<VisNode>
    where
        F: Fn(&GlobalNodeId) -> String,
    {
        match &self.kind {
            NodeKind::Operator => {
                let annotation = annotate(&self.id);
                Some(VisNode::Simple(SimpleNode::new(
                    Self::node_identifier(&self.id),
                    format!(
                        "{}{}{}",
                        self.name,
                        if annotation.is_empty() { "" } else { "\\l" },
                        annotation
                    ),
                )))
            }
            NodeKind::Circuit { region, .. } => {
                Some(VisNode::Cluster(region.visualize(self, annotate)))
            }
            NodeKind::StrictInput { output } => {
                let annotation = annotate(&self.id);
                Some(VisNode::Simple(SimpleNode::new(
                    Self::node_identifier(&self.id.parent_id().unwrap().child(*output)),
                    format!(
                        "{}{}{}",
                        self.name,
                        if annotation.is_empty() { "" } else { "\\l" },
                        annotation
                    ),
                )))
            }
            NodeKind::StrictOutput => None,
        }
    }
/// Output circuit node as a node in a visual graph.
Output circuit node as a node in a visual graph.
Output circuit node as a node in a visual graph .
fn visualize<F>(&self, annotate: &F) -> Option<VisNode>
    where
        F: Fn(&GlobalNodeId) -> String,
    {
        match &self.kind {
            NodeKind::Operator => {
                let annotation = annotate(&self.id);
                Some(VisNode::Simple(SimpleNode::new(
                    Self::node_identifier(&self.id),
                    format!(
                        "{}{}{}",
                        self.name,
                        if annotation.is_empty() { "" } else { "\\l" },
                        annotation
                    ),
                )))
            }
            NodeKind::Circuit { region, .. } => {
                Some(VisNode::Cluster(region.visualize(self, annotate)))
            }
            NodeKind::StrictInput { output } => {
                let annotation = annotate(&self.id);
                Some(VisNode::Simple(SimpleNode::new(
                    Self::node_identifier(&self.id.parent_id().unwrap().child(*output)),
                    format!(
                        "{}{}{}",
                        self.name,
                        if annotation.is_empty() { "" } else { "\\l" },
                        annotation
                    ),
                )))
            }
            NodeKind::StrictOutput => None,
        }
    }
fn visualize < F > ( & self , annotate : & F ) -> Option < VisNode > where F : Fn ( & GlobalNodeId ) -> String , { match & self . kind { NodeKind :: Operator => { let annotation = annotate ( & self . id ) ; Some ( VisNode :: Simple ( SimpleNode :: new ( Self :: node_identifier ( & self . id ) , format ! ( " " self name if annotation is_empty ( ) { " " } else { " \\ " } annotation ) , ) ) ) } NodeKind :: Circuit { region , .. } => { Some ( VisNode :: Cluster ( region . visualize ( self , annotate ) ) ) } NodeKind :: StrictInput { output } => { let annotation = annotate ( & self . id ) ; Some ( VisNode :: Simple ( SimpleNode :: new ( Self :: node_identifier ( & self . id . parent_id ( ) . unwrap ( ) . child ( * output ) ) , format ! ( " " self name if annotation is_empty ( ) { " " } else { " \\ " } annotation ) , ) ) ) } NodeKind :: StrictOutput => None , } }
Output circuit node as a node in a visual graph.
Output circuit node as a node in a visual graph .
&self
annotate
&F