pub(crate) async fn add_node_with_config(
        &mut self,
        cfg: R::Config,
        rng: &mut NodeRng,
    ) -> Result<(R::NodeId, &mut Runner<ConditionCheckReactor<R>>), R::Error> {
        let runner: Runner<ConditionCheckReactor<R>> = Runner::new(cfg, rng).await?;

        let node_id = runner.reactor().node_id();

        let node_ref = match self.nodes.entry(node_id.clone()) {
            Entry::Occupied(_) => {
                // This happens in the event of the extremely unlikely hash collision, or if the
                // node ID was set manually.
                panic!("trying to insert a duplicate node {}", node_id)
            }
            Entry::Vacant(entry) => entry.insert(runner),
        };

        Ok((node_id, node_ref))
    }
/// Creates a new networking node on the network.
///
/// # Panics
///
/// Panics if a duplicate node ID is being inserted.
Creates a new networking node on the network.
Creates a new networking node on the network .
pub(crate) async fn add_node_with_config(
        &mut self,
        cfg: R::Config,
        rng: &mut NodeRng,
    ) -> Result<(R::NodeId, &mut Runner<ConditionCheckReactor<R>>), R::Error> {
        let runner: Runner<ConditionCheckReactor<R>> = Runner::new(cfg, rng).await?;
        let node_id = runner.reactor().node_id();
        let node_ref = match self.nodes.entry(node_id.clone()) {
            Entry::Occupied(_) => {
                // This happens in the event of the extremely unlikely hash collision, or if the
                // node ID was set manually.
                panic!("trying to insert a duplicate node {}", node_id)
            }
            Entry::Vacant(entry) => entry.insert(runner),
        };
        Ok((node_id, node_ref))
    }
pub ( crate ) async fn add_node_with_config ( & mut self , cfg : R :: Config , rng : & mut NodeRng , ) -> Result < ( R :: NodeId , & mut Runner < ConditionCheckReactor < R > > ) , R :: Error > { let runner : Runner < ConditionCheckReactor < R > > = Runner :: new ( cfg , rng ) . await ? ; let node_id = runner . reactor ( ) . node_id ( ) ; let node_ref = match self . nodes . entry ( node_id . clone ( ) ) { Entry :: Occupied ( _ ) => { // This happens in the event of the extremely unlikely hash collision, or if the // node ID was set manually. panic ! ( " " node_id ) } Entry :: Vacant ( entry ) => entry . insert ( runner ) , } ; Ok ( ( node_id , node_ref ) ) }
Creates a new networking node on the network.
Creates a new networking node on the network .
&mut self
cfg
R::Config
rng
&mut NodeRng
&mut self
cfg
R::Config
rng
&mut NodeRng
panics
Panics if a duplicate node ID is being inserted.
Panics if a duplicate node ID is being inserted .