You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: main.rs
    path of file: ./repos/examples/basics/state/src
    
    the code of the file until where you have to start completion: //! Application may have multiple data objects that are shared across
//! all handlers within same Application.
//!
//! For global shared state, we wrap our state in a [`actix_web::web::Data`] and move it into
//! the factory closure. The closure is called once-per-thread, and we clone our state
//! and attach to each instance of the [`App`] with `.app_data(state.clone())`.
//!
//! For thread-local state, we construct our state within the factory closure and attach to
//! the app with `.app_data(Data::new(state))`.
//!
//! We retrieve our app state within our handlers with a `state: Data<...>` argument.
//!
//! By default, Actix Web runs one [`App`] per logical cpu core.
//! When 
    
async fn main() -> io::Result<()> {
    env_logger::init_from_env(env_logger::Env::new().default_filter_or("info"));

    // Create some global state prior to building the server
    #[allow(clippy::mutex_atomic)] // it's intentional.
    let counter_mutex = Data::new(Mutex::new(0usize));
    let counter_atomic = Data::new(AtomicUsize::new(0usize));

    log::info!("starting HTTP server at http://localhost:8080");

    // move is necessary to give closure below ownership of counter1
    HttpServer::new(move || {
        // Create some thread-local state
        let counter_cell = Cell::new(0u32);

        App::new()
            .app_data(counter_mutex.clone()) // add shared state
            .app_data(counter_atomic.clone()) // add shared state
            .app_data(Data::new(counter_cell)) // add thread-local state
            // enable logger
            .wrap(middleware::Logger::default())
            // register simple handler
            .service(web::resource("/").to(index))
    })
    .bind(("127.0.0.1", 8080))?
    .run()
    .await
}