diff options
author | Julius Michaelis <gitter@liftm.de> | 2020-07-09 17:33:12 +0900 |
---|---|---|
committer | Julius Michaelis <gitter@liftm.de> | 2020-07-09 20:52:30 +0900 |
commit | 27069656be40081303b7e3888b37b5c23231c5df (patch) | |
tree | f38bf2b767b67926779494eb9366669c4e2f202b /ipfs-api/src/client/internal.rs | |
parent | 0bb7f70f91c422705804ba1fd14411b8c07e6136 (diff) |
add ipfs files chcid
Diffstat (limited to 'ipfs-api/src/client/internal.rs')
-rw-r--r-- | ipfs-api/src/client/internal.rs | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/ipfs-api/src/client/internal.rs b/ipfs-api/src/client/internal.rs index ef4e9f2..6c646cc 100644 --- a/ipfs-api/src/client/internal.rs +++ b/ipfs-api/src/client/internal.rs @@ -1257,6 +1257,30 @@ impl IpfsClient { .await } + /// Change the cid version or hash function of the root node of a given path. + /// + /// ```no_run + /// use ipfs_api::IpfsClient; + /// use std::fs::File; + /// + /// let client = IpfsClient::default(); + /// let res = client.files_chcid("/test/", 1, Some("sha3-512")); + /// ``` + /// + /// Not specifying a byte `count` writes the entire input. + /// + #[inline] + pub async fn files_chcid( + &self, + path: &str, + cid_version: i32, + hash: Option<&str>, + ) -> Result<response::FilesChcidResponse, Error> + { + self.request_empty(request::FilesChcid { path, cid_version, hash }, None) + .await + } + /// List blocks that are both in the filestore and standard block storage. /// /// ```no_run |