fn index(
    data: web::Data<AppState>,
    request: web::HttpRequest,
) -> Result<HttpResponse, HttpResponse> {
    let headers = get_headers_hash_map(request.headers())?;

    // Check the credentials and signature headers of the request
    verify_authentication_header(&data.settings, &headers, &Vec::new())?;

    let json = data.scheduler.send(GetQueue{}).wait().unwrap();
    Ok(HttpResponse::Ok()
        .header(http::header::CONTENT_TYPE, "application/json")
        .body(json)
    )
}
/// Index route for getting current state of the server
Index route for getting current state of the server
Index route for getting current state of the server
fn index(
    data: web::Data<AppState>,
    request: web::HttpRequest,
) -> Result<HttpResponse, HttpResponse> {
    let headers = get_headers_hash_map(request.headers())?;
    // Check the credentials and signature headers of the request
    verify_authentication_header(&data.settings, &headers, &Vec::new())?;
    let json = data.scheduler.send(GetQueue{}).wait().unwrap();
    Ok(HttpResponse::Ok()
        .header(http::header::CONTENT_TYPE, "application/json")
        .body(json)
    )
}
fn index ( data : web :: Data < AppState > , request : web :: HttpRequest , ) -> Result < HttpResponse , HttpResponse > { let headers = get_headers_hash_map ( request . headers ( ) ) ? ; // Check the credentials and signature headers of the request verify_authentication_header ( & data . settings , & headers , & Vec :: new ( ) ) ? ; let json = data . scheduler . send ( GetQueue { } ) . wait ( ) . unwrap ( ) ; Ok ( HttpResponse :: Ok ( ) . header ( http :: header :: CONTENT_TYPE , " " ) . body ( json ) ) }
Index route for getting current state of the server
Index route for getting current state of the server
data
web::Data<AppState>
request
web::HttpRequest
data
web::Data<AppState>
request
web::HttpRequest