Handler

Handler of the Log messages is quite simple. We call the info method of Logger with a provided message and ignore errors with by converting a Result into an Option:

impl Handler<Log> for LogActor {
type Result = ();

fn handle(&mut self, Log(mesg): Log, _: &mut Context<Self>) -> Self::Result {
self.writer.info(mesg).ok();
}
}

The last actor we have to implement is the resizing actor.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.221.165.115