Types

Create the src/actors/count.rs module and import the following types:

use actix::{Actor, Context, Handler, Message};
use std::collections::HashMap;

type Value = u64;

We'll use the Actor trait to implement an actor's behavior, which works in a Context and receive a Message and handle it by the Handler trait implementation. Also, we need HashMap to store all counts. We also add the Value types alias and use it as a type for counting.

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

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