torrust-tracker 3.0.0

A feature rich BitTorrent tracker.
Documentation
1
2
3
4
5
6
7
8
9
10
11
//! API responses for the [`stats`](crate::servers::apis::v1::context::stats)
//! API context.
use axum::response::Json;

use super::resources::Stats;
use crate::core::services::statistics::TrackerMetrics;

/// `200` response that contains the [`Stats`] resource as json.
pub fn stats_response(tracker_metrics: TrackerMetrics) -> Json<Stats> {
    Json(Stats::from(tracker_metrics))
}