summaryrefslogtreecommitdiffstats
path: root/ipfs-api/src/response/dht.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ipfs-api/src/response/dht.rs')
-rw-r--r--ipfs-api/src/response/dht.rs19
1 files changed, 5 insertions, 14 deletions
diff --git a/ipfs-api/src/response/dht.rs b/ipfs-api/src/response/dht.rs
index 5279299..44de85d 100644
--- a/ipfs-api/src/response/dht.rs
+++ b/ipfs-api/src/response/dht.rs
@@ -9,7 +9,6 @@
use response::serde;
use serde::de::{Deserialize, Deserializer, Error};
-
/// See
/// [libp2p](https://github.com/libp2p/go-libp2p-routing/blob/master/notifications/query.go#L16).
///
@@ -45,34 +44,26 @@ impl<'de> Deserialize<'de> for DhtType {
}
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DhtPeerResponse {
- #[serde(rename = "ID")]
- pub id: String,
+ #[serde(rename = "ID")] pub id: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub addrs: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub addrs: Vec<String>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DhtMessage {
- #[serde(rename = "ID")]
- pub id: String,
+ #[serde(rename = "ID")] pub id: String,
- #[serde(rename = "Type")]
- pub typ: DhtType,
+ #[serde(rename = "Type")] pub typ: DhtType,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub responses: Vec<DhtPeerResponse>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub responses: Vec<DhtPeerResponse>,
pub extra: String,
}
-
pub type DhtFindPeerResponse = DhtMessage;
pub type DhtFindProvsResponse = DhtMessage;