fn try_add_node<F, N, T, E>(&self, f: F) -> Result<T, E>
    where
        F: FnOnce(NodeId) -> Result<(N, T), E>,
        N: Node + 'static,
    {
        let id = self.inner().nodes.len();

        // We don't hold a reference to `self.inner()` while calling `f`, so it can
        // safely modify the circuit, e.g., add edges.
        let (node, res) = f(NodeId(id))?;
        self.inner_mut().add_node(node);
        Ok(res)
    }
/// Like `add_node`, but the node is not created if the closure fails.
Like `add_node`, but the node is not created if the closure fails.
Like ` add_node ` but the node is not created if the closure fails .
fn try_add_node<F, N, T, E>(&self, f: F) -> Result<T, E>
    where
        F: FnOnce(NodeId) -> Result<(N, T), E>,
        N: Node + 'static,
    {
        let id = self.inner().nodes.len();
        // We don't hold a reference to `self.inner()` while calling `f`, so it can
        // safely modify the circuit, e.g., add edges.
        let (node, res) = f(NodeId(id))?;
        self.inner_mut().add_node(node);
        Ok(res)
    }
fn try_add_node < F , N , T , E > ( & self , f : F ) -> Result < T , E > where F : FnOnce ( NodeId ) -> Result < ( N , T ) , E > , N : Node + ' static , { let id = self . inner ( ) . nodes . len ( ) ; // We don't hold a reference to `self.inner()` while calling `f`, so it can // safely modify the circuit, e.g., add edges. let ( node , res ) = f ( NodeId ( id ) ) ? ; self . inner_mut ( ) . add_node ( node ) ; Ok ( res ) }
Like `add_node`, but the node is not created if the closure fails.
Like ` add_node ` but the node is not created if the closure fails .
&self
f
F