rosetta_types/peer.rs
1/*
2 * Rosetta
3 *
4 * Build Once. Integrate Your Blockchain Everywhere.
5 *
6 * The version of the OpenAPI document: 1.4.13
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11/// Peer : A Peer is a representation of a node's peer.
12
13#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
14pub struct Peer {
15 #[serde(rename = "peer_id")]
16 pub peer_id: String,
17 #[serde(rename = "metadata", skip_serializing_if = "Option::is_none")]
18 pub metadata: Option<serde_json::Value>,
19}
20
21impl Peer {
22 /// A Peer is a representation of a node's peer.
23 pub fn new(peer_id: String) -> Peer {
24 Peer {
25 peer_id,
26 metadata: None,
27 }
28 }
29}