fn new_client<'a, C: Clock>(
        &'a mut self,
        network: &'a mut N,
        clock: Option<&'a C>,
    ) -> Result<Client<'a, N, C, P>, ConnectionError> {
        self.connect_socket(network)?;
        let credentials = self.authentication.clone();
        let client = self.create_client(network, clock);

        match client.init(credentials) {
            Ok(response) => {
                self.hello_response = response;
                Ok(self.create_client(network, clock))
            }
            Err(error) => {
                self.auth_failed = true;
                Err(error)
            }
        }
    }
/// Creates and authenticates a new client
Creates and authenticates a new client
Creates and authenticates a new client
fn new_client<'a, C: Clock>(
        &'a mut self,
        network: &'a mut N,
        clock: Option<&'a C>,
    ) -> Result<Client<'a, N, C, P>, ConnectionError> {
        self.connect_socket(network)?;
        let credentials = self.authentication.clone();
        let client = self.create_client(network, clock);
        match client.init(credentials) {
            Ok(response) => {
                self.hello_response = response;
                Ok(self.create_client(network, clock))
            }
            Err(error) => {
                self.auth_failed = true;
                Err(error)
            }
        }
    }
fn new_client < ' a , C : Clock > ( & ' a mut self , network : & ' a mut N , clock : Option < & ' a C > , ) -> Result < Client < ' a , N , C , P > , ConnectionError > { self . connect_socket ( network ) ? ; let credentials = self . authentication . clone ( ) ; let client = self . create_client ( network , clock ) ; match client . init ( credentials ) { Ok ( response ) => { self . hello_response = response ; Ok ( self . create_client ( network , clock ) ) } Err ( error ) => { self . auth_failed = true ; Err ( error ) } } }
Creates and authenticates a new client
Creates and authenticates a new client
&'a mut self
network
&'a mut N
clock
Option<&'a C>
&'a mut self
network
&'a mut N
clock
Option<&'a C>