pub(crate) fn dialing_peer(&mut self) -> Result<(), &'static str> {
        match &mut self.connection_status {
            Connected { .. } => return Err("Dialing connected peer"),
            Dialing { .. } => return Err("Dialing an already dialing peer"),
            Disconnecting { .. } => return Err("Dialing a disconnecting peer"),
            Disconnected { .. } | Banned { .. } | Unknown => {}
        }
        self.connection_status = Dialing {
            since: Instant::now(),
        };
        Ok(())
    }
/// Modifies the status to Dialing
/// Returns an error if the current state is unexpected.
Modifies the status to Dialing
Returns an error if the current state is unexpected.
Modifies the status to Dialing Returns an error if the current state is unexpected .
pub(crate) fn dialing_peer(&mut self) -> Result<(), &'static str> {
        match &mut self.connection_status {
            Connected { .. } => return Err("Dialing connected peer"),
            Dialing { .. } => return Err("Dialing an already dialing peer"),
            Disconnecting { .. } => return Err("Dialing a disconnecting peer"),
            Disconnected { .. } | Banned { .. } | Unknown => {}
        }
        self.connection_status = Dialing {
            since: Instant::now(),
        };
        Ok(())
    }
pub ( crate ) fn dialing_peer ( & mut self ) -> Result < ( ) , & ' static str > { match & mut self . connection_status { Connected { .. } => return Err ( " " ) , Dialing { .. } => return Err ( " " ) , Disconnecting { .. } => return Err ( " " ) , Disconnected { .. } | Banned { .. } | Unknown => { } } self . connection_status = Dialing { since : Instant :: now ( ) , } ; Ok ( ( ) ) }
Modifies the status to Dialing
Returns an error if the current state is unexpected.
Modifies the status to Dialing Returns an error if the current state is unexpected .
&mut self