MCPcopy Create free account
hub / github.com/actix/examples / get_count

Function get_count

websockets/chat/src/main.rs:43–46  ·  view source on GitHub ↗

Displays state

(count: web::Data<AtomicUsize>)

Source from the content-addressed store, hash-verified

41
42/// Displays state
43async fn get_count(count: web::Data<AtomicUsize>) -> impl Responder {
44 let current_count = count.load(Ordering::SeqCst);
45 format!("Visitors: {current_count}")
46}
47
48// the actor-based WebSocket examples REQUIRE `actix_web::main` for actor support
49#[actix_web::main]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected