use std::sync::Arc; use atlasserver::*; struct MyServer { resources: ::Resources, } impl CustomServer for MyServer { type Resources = Hlist![Arc]; const MODULES: &'static [Module] = &[Module { name: "userlogin", call: userlogin::UserLogin::create_filter, }]; fn get_resources(&self) -> &Self::Resources { &self.resources } } impl ModuleResources for MyServer { fn get_server_resources( &self, ) -> ::Resources { let (reshaped, _) = self.get_resources().clone().sculpt(); reshaped } } #[tokio::main] async fn main() -> Result<(), Box> { let session_db = Arc::new(userlogin::sessions::InMemorySessionDB::default()); let user_db = Arc::new( userlogin::user::in_memory::InMemoryUserDB::default(), ); let server = Arc::new(MyServer { resources: hlist![Arc::new( userlogin::UserLoginResource::new(session_db, user_db) ),], }); atlasserver::init(server, ([0, 0, 0, 0], 8080)).await; Ok(()) }