summaryrefslogtreecommitdiffstats
path: root/ipfs-api/src/response
diff options
context:
space:
mode:
authorFerris Tseng <ferristseng@fastmail.fm>2018-01-23 18:30:11 -0500
committerFerris Tseng <ferristseng@fastmail.fm>2018-01-23 18:30:11 -0500
commitc2f1199de55897cc98d7663f171329a04e63b230 (patch)
tree37d5fcd052f9fce50eacae78633cf09a1c8a9901 /ipfs-api/src/response
parent06a3776548b8c81226ef61715e5a2e98e29799c9 (diff)
formatting
Diffstat (limited to 'ipfs-api/src/response')
-rw-r--r--ipfs-api/src/response/bitswap.rs14
-rw-r--r--ipfs-api/src/response/block.rs3
-rw-r--r--ipfs-api/src/response/bootstrap.rs13
-rw-r--r--ipfs-api/src/response/commands.rs12
-rw-r--r--ipfs-api/src/response/config.rs2
-rw-r--r--ipfs-api/src/response/dag.rs10
-rw-r--r--ipfs-api/src/response/dht.rs19
-rw-r--r--ipfs-api/src/response/diag.rs2
-rw-r--r--ipfs-api/src/response/error.rs2
-rw-r--r--ipfs-api/src/response/file.rs9
-rw-r--r--ipfs-api/src/response/files.rs19
-rw-r--r--ipfs-api/src/response/filestore.rs6
-rw-r--r--ipfs-api/src/response/id.rs8
-rw-r--r--ipfs-api/src/response/log.rs6
-rw-r--r--ipfs-api/src/response/ls.rs13
-rw-r--r--ipfs-api/src/response/mod.rs6
-rw-r--r--ipfs-api/src/response/mount.rs7
-rw-r--r--ipfs-api/src/response/name.rs2
-rw-r--r--ipfs-api/src/response/object.rs49
-rw-r--r--ipfs-api/src/response/pin.rs18
-rw-r--r--ipfs-api/src/response/ping.rs1
-rw-r--r--ipfs-api/src/response/pubsub.rs17
-rw-r--r--ipfs-api/src/response/refs.rs4
-rw-r--r--ipfs-api/src/response/repo.rs9
-rw-r--r--ipfs-api/src/response/resolve.rs1
-rw-r--r--ipfs-api/src/response/serde.rs3
-rw-r--r--ipfs-api/src/response/stats.rs4
-rw-r--r--ipfs-api/src/response/swarm.rs30
-rw-r--r--ipfs-api/src/response/tar.rs1
-rw-r--r--ipfs-api/src/response/version.rs1
30 files changed, 60 insertions, 231 deletions
diff --git a/ipfs-api/src/response/bitswap.rs b/ipfs-api/src/response/bitswap.rs
index 6280bfb..69b9705 100644
--- a/ipfs-api/src/response/bitswap.rs
+++ b/ipfs-api/src/response/bitswap.rs
@@ -8,7 +8,6 @@
use response::serde;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BitswapLedgerResponse {
@@ -19,17 +18,14 @@ pub struct BitswapLedgerResponse {
pub exchanged: u64,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BitswapStatResponse {
pub provide_buf_len: i32,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub wantlist: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub wantlist: Vec<String>,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub peers: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub peers: Vec<String>,
pub blocks_received: u64,
pub data_received: u64,
@@ -39,18 +35,14 @@ pub struct BitswapStatResponse {
pub dup_data_received: u64,
}
-
pub type BitswapUnwantResponse = ();
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BitswapWantlistResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub keys: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub keys: Vec<String>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_bitswap_stat_0, BitswapStatResponse);
diff --git a/ipfs-api/src/response/block.rs b/ipfs-api/src/response/block.rs
index 34855e2..c04bd89 100644
--- a/ipfs-api/src/response/block.rs
+++ b/ipfs-api/src/response/block.rs
@@ -13,7 +13,6 @@ pub struct BlockPutResponse {
pub size: u64,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BlockRmResponse {
@@ -21,7 +20,6 @@ pub struct BlockRmResponse {
pub error: Option<String>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BlockStatResponse {
@@ -29,7 +27,6 @@ pub struct BlockStatResponse {
pub size: u64,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_block_stat_0, BlockStatResponse);
diff --git a/ipfs-api/src/response/bootstrap.rs b/ipfs-api/src/response/bootstrap.rs
index 480e519..a8477ce 100644
--- a/ipfs-api/src/response/bootstrap.rs
+++ b/ipfs-api/src/response/bootstrap.rs
@@ -8,31 +8,24 @@
use response::serde;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BootstrapAddDefaultResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub peers: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub peers: Vec<String>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BootstrapListResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub peers: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub peers: Vec<String>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BootstrapRmAllResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub peers: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub peers: Vec<String>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_bootstrap_list_0, BootstrapListResponse);
diff --git a/ipfs-api/src/response/commands.rs b/ipfs-api/src/response/commands.rs
index bbdeaaa..261d0c5 100644
--- a/ipfs-api/src/response/commands.rs
+++ b/ipfs-api/src/response/commands.rs
@@ -8,28 +8,22 @@
use response::serde;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CommandsResponseOptions {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub names: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub names: Vec<String>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct CommandsResponse {
pub name: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub subcommands: Vec<CommandsResponse>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub subcommands: Vec<CommandsResponse>,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub options: Vec<CommandsResponseOptions>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub options: Vec<CommandsResponseOptions>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_commands_0, CommandsResponse);
diff --git a/ipfs-api/src/response/config.rs b/ipfs-api/src/response/config.rs
index 84da149..81e8caf 100644
--- a/ipfs-api/src/response/config.rs
+++ b/ipfs-api/src/response/config.rs
@@ -8,8 +8,6 @@
pub type ConfigEditResponse = ();
-
pub type ConfigReplaceResponse = ();
-
pub type ConfigShowResponse = String;
diff --git a/ipfs-api/src/response/dag.rs b/ipfs-api/src/response/dag.rs
index 6d5e25b..3f801da 100644
--- a/ipfs-api/src/response/dag.rs
+++ b/ipfs-api/src/response/dag.rs
@@ -9,34 +9,28 @@
use response::serde;
use std::collections::HashMap;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DagIpfsHeader {
pub name: String,
pub size: u64,
- #[serde(deserialize_with = "serde::deserialize_hashmap")]
- pub cid: HashMap<String, String>,
+ #[serde(deserialize_with = "serde::deserialize_hashmap")] pub cid: HashMap<String, String>,
}
-
#[derive(Debug, Deserialize)]
pub struct DagGetResponse {
pub data: Option<String>,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<DagIpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<DagIpfsHeader>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct DagPutResponse {
pub cid: String,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_dag_get_0, DagGetResponse);
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;
diff --git a/ipfs-api/src/response/diag.rs b/ipfs-api/src/response/diag.rs
index e445ee9..382fe66 100644
--- a/ipfs-api/src/response/diag.rs
+++ b/ipfs-api/src/response/diag.rs
@@ -8,8 +8,6 @@
pub type DiagCmdsClearResponse = ();
-
pub type DiagCmdsSetTimeResponse = ();
-
pub type DiagSysResponse = String;
diff --git a/ipfs-api/src/response/error.rs b/ipfs-api/src/response/error.rs
index 5f67eec..7075def 100644
--- a/ipfs-api/src/response/error.rs
+++ b/ipfs-api/src/response/error.rs
@@ -11,7 +11,6 @@ use serde_json;
use serde_urlencoded;
use std::string::FromUtf8Error;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ApiError {
@@ -19,7 +18,6 @@ pub struct ApiError {
pub code: u8,
}
-
error_chain! {
foreign_links {
Http(hyper::error::Error);
diff --git a/ipfs-api/src/response/file.rs b/ipfs-api/src/response/file.rs
index 7623135..3b670f7 100644
--- a/ipfs-api/src/response/file.rs
+++ b/ipfs-api/src/response/file.rs
@@ -9,21 +9,17 @@
use response::{serde, IpfsHeader};
use std::collections::HashMap;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct IpfsDetailedFile {
pub hash: String,
pub size: u64,
- #[serde(rename = "Type")]
- pub typ: String,
+ #[serde(rename = "Type")] pub typ: String,
- #[serde(default)]
- pub links: Vec<IpfsHeader>,
+ #[serde(default)] pub links: Vec<IpfsHeader>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FileLsResponse {
@@ -34,7 +30,6 @@ pub struct FileLsResponse {
pub objects: HashMap<String, IpfsDetailedFile>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_file_ls_0, FileLsResponse);
diff --git a/ipfs-api/src/response/files.rs b/ipfs-api/src/response/files.rs
index ae0c7d8..087c0ba 100644
--- a/ipfs-api/src/response/files.rs
+++ b/ipfs-api/src/response/files.rs
@@ -8,13 +8,10 @@
use response::serde;
-
pub type FilesCpResponse = ();
-
pub type FilesFlushResponse = ();
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FilesEntry {
@@ -23,30 +20,23 @@ pub struct FilesEntry {
// This is a protocol buffer enum type defined in
// https://github.com/ipfs/go-ipfs/blob/master/unixfs/pb/unixfs.proto ...
// So it might be some other type than u64, but certainly shouldn't be *bigger* than u64.
- #[serde(rename = "Type")]
- pub typ: u64,
+ #[serde(rename = "Type")] pub typ: u64,
pub size: u64,
pub hash: String,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FilesLsResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub entries: Vec<FilesEntry>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub entries: Vec<FilesEntry>,
}
-
pub type FilesMkdirResponse = ();
-
pub type FilesMvResponse = ();
-
pub type FilesRmResponse = ();
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FilesStatResponse {
@@ -55,14 +45,11 @@ pub struct FilesStatResponse {
pub cumulative_size: u64,
pub blocks: u64,
- #[serde(rename = "Type")]
- pub typ: String,
+ #[serde(rename = "Type")] pub typ: String,
}
-
pub type FilesWriteResponse = ();
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_files_ls_0, FilesLsResponse);
diff --git a/ipfs-api/src/response/filestore.rs b/ipfs-api/src/response/filestore.rs
index f2f62e5..5b369bc 100644
--- a/ipfs-api/src/response/filestore.rs
+++ b/ipfs-api/src/response/filestore.rs
@@ -9,13 +9,11 @@
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FilestoreDupsResponse {
- #[serde(rename = "Ref")]
- pub reference: String,
+ #[serde(rename = "Ref")] pub reference: String,
pub err: String,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct FilestoreObject {
@@ -27,8 +25,6 @@ pub struct FilestoreObject {
pub size: u64,
}
-
pub type FilestoreLsResponse = FilestoreObject;
-
pub type FilestoreVerifyResponse = FilestoreObject;
diff --git a/ipfs-api/src/response/id.rs b/ipfs-api/src/response/id.rs
index 72a0569..4aca2f6 100644
--- a/ipfs-api/src/response/id.rs
+++ b/ipfs-api/src/response/id.rs
@@ -8,23 +8,19 @@
use response::serde;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct IdResponse {
- #[serde(rename = "ID")]
- pub id: String,
+ #[serde(rename = "ID")] pub id: String,
pub public_key: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub addresses: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub addresses: Vec<String>,
pub agent_version: String,
pub protocol_version: String,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_id_0, IdResponse);
diff --git a/ipfs-api/src/response/log.rs b/ipfs-api/src/response/log.rs
index 643d341..da3fb34 100644
--- a/ipfs-api/src/response/log.rs
+++ b/ipfs-api/src/response/log.rs
@@ -8,22 +8,18 @@
use response::serde;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct LogLevelResponse {
pub message: String,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct LogLsResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub strings: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub strings: Vec<String>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_log_ls_0, LogLsResponse);
diff --git a/ipfs-api/src/response/ls.rs b/ipfs-api/src/response/ls.rs
index fa9a26b..8508a37 100644
--- a/ipfs-api/src/response/ls.rs
+++ b/ipfs-api/src/response/ls.rs
@@ -8,17 +8,14 @@
use response::serde;
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct IpfsFile {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsFileHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsFileHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct IpfsFileHeader {
@@ -26,19 +23,15 @@ pub struct IpfsFileHeader {
pub hash: String,
pub size: u64,
- #[serde(rename = "Type")]
- pub typ: u32,
+ #[serde(rename = "Type")] pub typ: u32,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct LsResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub objects: Vec<IpfsFile>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub objects: Vec<IpfsFile>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_ls_0, LsResponse);
diff --git a/ipfs-api/src/response/mod.rs b/ipfs-api/src/response/mod.rs
index e42c067..f08b6dc 100644
--- a/ipfs-api/src/response/mod.rs
+++ b/ipfs-api/src/response/mod.rs
@@ -40,7 +40,6 @@ pub use self::swarm::*;
pub use self::tar::*;
pub use self::version::*;
-
/// Create a test to deserialize a file to the given instance.
///
#[cfg(test)]
@@ -58,7 +57,6 @@ macro_rules! deserialize_test {
)
}
-
mod add;
mod bitswap;
mod block;
@@ -92,7 +90,6 @@ mod swarm;
mod tar;
mod version;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct IpfsHeader {
@@ -100,6 +97,5 @@ pub struct IpfsHeader {
pub hash: String,
pub size: u64,
- #[serde(rename = "Type")]
- pub typ: Option<String>,
+ #[serde(rename = "Type")] pub typ: Option<String>,
}
diff --git a/ipfs-api/src/response/mount.rs b/ipfs-api/src/response/mount.rs
index 1479aa3..94517a2 100644
--- a/ipfs-api/src/response/mount.rs
+++ b/ipfs-api/src/response/mount.rs
@@ -9,16 +9,13 @@
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct MountResponse {
- #[serde(rename = "IPFS")]
- pub ipfs: String,
+ #[serde(rename = "IPFS")] pub ipfs: String,
- #[serde(rename = "IPNS")]
- pub ipns: String,
+ #[serde(rename = "IPNS")] pub ipns: String,
pub fuse_allow_other: bool,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_mount_0, MountResponse);
diff --git a/ipfs-api/src/response/name.rs b/ipfs-api/src/response/name.rs
index 00d8cda..de142db 100644
--- a/ipfs-api/src/response/name.rs
+++ b/ipfs-api/src/response/name.rs
@@ -13,14 +13,12 @@ pub struct NamePublishResponse {
pub value: String,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct NameResolveResponse {
pub path: String,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_name_resolve_0, NameResolveResponse);
diff --git a/ipfs-api/src/response/object.rs b/ipfs-api/src/response/object.rs
index de5923c..78fd271 100644
--- a/ipfs-api/src/response/object.rs
+++ b/ipfs-api/src/response/object.rs
@@ -9,114 +9,90 @@
use response::{serde, IpfsHeader};
use std::collections::HashMap;
-
pub type ObjectDataResponse = Vec<u8>;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectDiff {
- #[serde(rename = "Type")]
- pub typ: u64,
+ #[serde(rename = "Type")] pub typ: u64,
pub path: String,
- #[serde(deserialize_with = "serde::deserialize_hashmap")]
- pub before: HashMap<String, String>,
+ #[serde(deserialize_with = "serde::deserialize_hashmap")] pub before: HashMap<String, String>,
- #[serde(deserialize_with = "serde::deserialize_hashmap")]
- pub after: HashMap<String, String>,
+ #[serde(deserialize_with = "serde::deserialize_hashmap")] pub after: HashMap<String, String>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectDiffResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub changes: Vec<ObjectDiff>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub changes: Vec<ObjectDiff>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectGetResponse {
pub data: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectLinksResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectNewResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectPatchAddLinkResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectPatchAppendDataResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectPatchRmLinkResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectPatchSetDataResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectPutResponse {
pub hash: String,
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub links: Vec<IpfsHeader>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub links: Vec<IpfsHeader>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct ObjectStatResponse {
@@ -128,7 +104,6 @@ pub struct ObjectStatResponse {
pub cumulative_size: u64,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_object_diff_0, ObjectDiffResponse);
diff --git a/ipfs-api/src/response/pin.rs b/ipfs-api/src/response/pin.rs
index 2b8b4ef..4a9ff6e 100644
--- a/ipfs-api/src/response/pin.rs
+++ b/ipfs-api/src/response/pin.rs
@@ -9,42 +9,32 @@
use response::serde;
use std::collections::HashMap;
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PinAddResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub pins: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub pins: Vec<String>,
pub progress: Option<i32>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PinType {
- #[serde(rename = "Type")]
- pub typ: String,
+ #[serde(rename = "Type")] pub typ: String,
}
-
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PinLsResponse {
- #[serde(deserialize_with = "serde::deserialize_hashmap")]
- pub keys: HashMap<String, PinType>,
+ #[serde(deserialize_with = "serde::deserialize_hashmap")] pub keys: HashMap<String, PinType>,
}
-
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct PinRmResponse {
- #[serde(deserialize_with = "serde::deserialize_vec")]
- pub pins: Vec<String>,
+ #[serde(deserialize_with = "serde::deserialize_vec")] pub pins: Vec<String>,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_pin_ls_0, PinLsResponse);
diff --git a/ipfs-api/src/response/ping.rs b/ipfs-api/src/response/ping.rs
index 165ed39..977ef90 100644
--- a/ipfs-api/src/response/ping.rs
+++ b/ipfs-api/src/response/ping.rs
@@ -14,7 +14,6 @@ pub struct PingResponse {
pub text: String,
}
-
#[cfg(test)]
mod tests {
deserialize_test!(v0_ping_0, PingResponse);
diff --git a/ipfs-api/src/response/pubsub.rs b/ipfs-api/src/response/pubsub.rs
index e35b30f..20621e1 100644
--- a/ipfs-api/src/response/pubsub.rs
+++ b/ipfs-api/src/response/pubsub.rs
@@ -8,40 +8,31 @@
use response::serde;