Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

actix web

#[derive(Serialize)]
struct Measurement {
    temperature: f32,
}

async fn hello_world() -> impl Responder {
    "Hello World!"
}

async fn current_temperature() -> impl Responder {
    web::Json(Measurement { temperature: 42.3 })
}
Source by actix.rs #
 
PREVIOUS NEXT
Tagged: #actix #web
ADD COMMENT
Topic
Name
7+5 =