summaryrefslogtreecommitdiffstats
path: root/ipfs-api/src/response
diff options
context:
space:
mode:
Diffstat (limited to 'ipfs-api/src/response')
-rw-r--r--ipfs-api/src/response/bitswap.rs8
-rw-r--r--ipfs-api/src/response/block.rs4
-rw-r--r--ipfs-api/src/response/files.rs8
-rw-r--r--ipfs-api/src/response/object.rs12
-rw-r--r--ipfs-api/src/response/pin.rs2
-rw-r--r--ipfs-api/src/response/repo.rs4
6 files changed, 21 insertions, 17 deletions
diff --git a/ipfs-api/src/response/bitswap.rs b/ipfs-api/src/response/bitswap.rs
index acfad56..6280bfb 100644
--- a/ipfs-api/src/response/bitswap.rs
+++ b/ipfs-api/src/response/bitswap.rs
@@ -23,7 +23,7 @@ pub struct BitswapLedgerResponse {
#[derive(Debug, Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct BitswapStatResponse {
- pub provide_buf_len: usize,
+ pub provide_buf_len: i32,
#[serde(deserialize_with = "serde::deserialize_vec")]
pub wantlist: Vec<String>,
@@ -31,11 +31,11 @@ pub struct BitswapStatResponse {
#[serde(deserialize_with = "serde::deserialize_vec")]
pub peers: Vec<String>,
- pub blocks_received: usize,
+ pub blocks_received: u64,
pub data_received: u64,
- pub blocks_sent: usize,
+ pub blocks_sent: u64,
pub data_sent: u64,
- pub dup_blks_received: usize,
+ pub dup_blks_received: u64,
pub dup_data_received: u64,
}
diff --git a/ipfs-api/src/response/block.rs b/ipfs-api/src/response/block.rs
index d1e446a..34855e2 100644
--- a/ipfs-api/src/response/block.rs
+++ b/ipfs-api/src/response/block.rs
@@ -10,7 +10,7 @@
#[serde(rename_all = "PascalCase")]
pub struct BlockPutResponse {
pub key: String,
- pub size: usize,
+ pub size: u64,
}
@@ -26,7 +26,7 @@ pub struct BlockRmResponse {
#[serde(rename_all = "PascalCase")]
pub struct BlockStatResponse {
pub key: String,
- pub size: usize,
+ pub size: u64,
}
diff --git a/ipfs-api/src/response/files.rs b/ipfs-api/src/response/files.rs
index c0adbfb..1b073de 100644
--- a/ipfs-api/src/response/files.rs
+++ b/ipfs-api/src/response/files.rs
@@ -20,9 +20,11 @@ pub type FilesFlushResponse = ();
pub struct FilesEntry {
pub name: String,
+ // 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: isize,
- pub size: i64,
+ pub typ: u64,
+ pub size: u64,
pub hash: String,
}
@@ -50,7 +52,7 @@ pub struct FilesStatResponse {
pub hash: String,
pub size: u64,
pub cumulative_size: u64,
- pub blocks: isize,
+ pub blocks: u64,
#[serde(rename = "Type")]
pub typ: String,
diff --git a/ipfs-api/src/response/object.rs b/ipfs-api/src/response/object.rs
index 5e36676..de5923c 100644
--- a/ipfs-api/src/response/object.rs
+++ b/ipfs-api/src/response/object.rs
@@ -17,7 +17,7 @@ pub type ObjectDataResponse = Vec<u8>;
#[serde(rename_all = "PascalCase")]
pub struct ObjectDiff {
#[serde(rename = "Type")]
- pub typ: isize,
+ pub typ: u64,
pub path: String,
@@ -121,11 +121,11 @@ pub struct ObjectPutResponse {
#[serde(rename_all = "PascalCase")]
pub struct ObjectStatResponse {
pub hash: String,
- pub num_links: isize,
- pub block_size: isize,
- pub links_size: isize,
- pub data_size: isize,
- pub cumulative_size: isize,
+ pub num_links: u64,
+ pub block_size: u64,
+ pub links_size: u64,
+ pub data_size: u64,
+ pub cumulative_size: u64,
}
diff --git a/ipfs-api/src/response/pin.rs b/ipfs-api/src/response/pin.rs
index e6e4192..2b8b4ef 100644
--- a/ipfs-api/src/response/pin.rs
+++ b/ipfs-api/src/response/pin.rs
@@ -16,7 +16,7 @@ pub struct PinAddResponse {
#[serde(deserialize_with = "serde::deserialize_vec")]
pub pins: Vec<String>,
- pub progress: Option<isize>,
+ pub progress: Option<i32>,
}
diff --git a/ipfs-api/src/response/repo.rs b/ipfs-api/src/response/repo.rs
index 24260c5..fb82936 100644
--- a/ipfs-api/src/response/repo.rs
+++ b/ipfs-api/src/response/repo.rs
@@ -36,11 +36,13 @@ pub struct RepoStatResponse {
}
+// Defined in go-ipfs:master core/commands/repo.go
#[derive(Deserialize)]
#[serde(rename_all = "PascalCase")]
pub struct RepoVerifyResponse {
pub message: String,
- pub progress: isize,
+ // Could technically be an i64 but this is probably safest?
+ pub progress: i32,
}