async fn run_inner(&mut self) -> Result<()> {
        self.worker.initialize(&mut self.ctx)?;

        // Loop until the last sender disappears
        while let Some(ref enc) = self.rx.recv().await {
            let msg = match M::decode(enc) {
                Ok(msg) => msg,
                _ => continue,
            };

            self.worker.handle_message(&mut self.ctx, msg).await?;
        }

        // Errors that occur during shut-down should be logged, but
        // not re-start the worker automatically!
        match self.worker.shutdown(&mut self.ctx) {
            Ok(()) => Ok(()),
            Err(e) => {
                eprintln!(
                    "Worker '{}' error during shutdown: {}",
                    self.ctx.address(),
                    e.to_string()
                );
                Ok(())
            }
        }
    }
/// A wrapper function around the lifetime of a worker
A wrapper function around the lifetime of a worker
A wrapper function around the lifetime of a worker
async fn run_inner(&mut self) -> Result<()> {
        self.worker.initialize(&mut self.ctx)?;
        // Loop until the last sender disappears
        while let Some(ref enc) = self.rx.recv().await {
            let msg = match M::decode(enc) {
                Ok(msg) => msg,
                _ => continue,
            };
            self.worker.handle_message(&mut self.ctx, msg).await?;
        }
        // Errors that occur during shut-down should be logged, but
        // not re-start the worker automatically!
        match self.worker.shutdown(&mut self.ctx) {
            Ok(()) => Ok(()),
            Err(e) => {
                eprintln!(
                    "Worker '{}' error during shutdown: {}",
                    self.ctx.address(),
                    e.to_string()
                );
                Ok(())
            }
        }
    }
async fn run_inner ( & mut self ) -> Result < ( ) > { self . worker . initialize ( & mut self . ctx ) ? ; // Loop until the last sender disappears while let Some ( ref enc ) = self . rx . recv ( ) . await { let msg = match M :: decode ( enc ) { Ok ( msg ) => msg , _ => continue , } ; self . worker . handle_message ( & mut self . ctx , msg ) . await ? ; } // Errors that occur during shut-down should be logged, but // not re-start the worker automatically! match self . worker . shutdown ( & mut self . ctx ) { Ok ( ( ) ) => Ok ( ( ) ) , Err ( e ) => { eprintln ! ( " " self ctx address ( ) e to_string ( ) ) ; Ok ( ( ) ) } } }
A wrapper function around the lifetime of a worker
A wrapper function around the lifetime of a worker
&mut self
&mut self