tendermint/channel/id.rs
1use serde::{Deserialize, Serialize};
2
3/// Channel IDs
4#[derive(Copy, Clone, Debug, Deserialize, Serialize)]
5pub struct Id(pub u64);
6
7impl Id {
8 /// Get the current channel id as an integer
9 pub fn value(self) -> u64 {
10 self.0
11 }
12}
13
14impl From<Id> for u64 {
15 fn from(id: Id) -> u64 {
16 id.value()
17 }
18}
19
20impl From<u64> for Id {
21 fn from(id: u64) -> Id {
22 Id(id)
23 }
24}