tendermint/
channel.rs

1//! Channels (RPC types)
2
3mod id;
4
5use core::fmt::{self, Display};
6
7use serde::{Deserialize, Serialize};
8
9pub use self::id::Id;
10use crate::{prelude::*, serializers};
11
12/// Channels
13#[derive(Clone, Debug, Deserialize, Serialize)]
14pub struct Channel {
15    /// Channel ID
16    #[serde(rename = "ID")]
17    pub id: Id,
18
19    /// Capacity of the send queue
20    #[serde(rename = "SendQueueCapacity", with = "serializers::from_str")]
21    pub send_queue_capacity: u64,
22
23    /// Size of the send queue
24    #[serde(rename = "SendQueueSize", with = "serializers::from_str")]
25    pub send_queue_size: u64,
26
27    /// Priority value
28    #[serde(rename = "Priority", with = "serializers::from_str")]
29    pub priority: u64,
30
31    /// Amount of data recently sent
32    #[serde(rename = "RecentlySent", with = "serializers::from_str")]
33    pub recently_sent: u64,
34}
35
36/// Channel collections
37#[derive(Clone, Debug, Deserialize, Eq, PartialEq, Serialize, Default)]
38pub struct Channels(String);
39
40impl Display for Channels {
41    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
42        write!(f, "{}", self.0)
43    }
44}