ipfs_api_prelude/response/
stats.rs

1// Copyright 2017 rust-ipfs-api Developers
2//
3// Licensed under the Apache License, Version 2.0, <LICENSE-APACHE or
4// http://apache.org/licenses/LICENSE-2.0> or the MIT license <LICENSE-MIT or
5// http://opensource.org/licenses/MIT>, at your option. This file may not be
6// copied, modified, or distributed except according to those terms.
7//
8
9use crate::response::{BitswapStatResponse, RepoStatResponse};
10use crate::serde::Deserialize;
11
12pub type StatsBitswapResponse = BitswapStatResponse;
13
14#[derive(Debug, Deserialize)]
15#[serde(rename_all = "PascalCase")]
16pub struct StatsBwResponse {
17    pub total_in: u64,
18    pub total_out: u64,
19    pub rate_in: f64,
20    pub rate_out: f64,
21}
22
23pub type StatsRepoResponse = RepoStatResponse;
24
25#[cfg(test)]
26mod tests {
27    deserialize_test!(v0_stats_bw_0, StatsBwResponse);
28}