diff options
author | Simon Heath <icefoxen@gmail.com> | 2017-12-05 11:50:10 -0500 |
---|---|---|
committer | Simon Heath <icefoxen@gmail.com> | 2017-12-05 11:50:10 -0500 |
commit | 2a5f612e0498e19fdd28e9cc70fe3e099d778801 (patch) | |
tree | c580f16206361b2cfa7b576630d3b7cb554ff9b1 | |
parent | 753b5ae81885958a416ef2a4876a4231671cc22e (diff) | |
parent | 2f6025ad1372f25956655c0a27c2e513ee78e577 (diff) |
Merge branch 'pin-add' of https://github.com/icefoxen/rust-ipfs-api-1 into pin-add
-rw-r--r-- | ipfs-api/src/client.rs | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/ipfs-api/src/client.rs b/ipfs-api/src/client.rs index 68b4cdb..387d48d 100644 --- a/ipfs-api/src/client.rs +++ b/ipfs-api/src/client.rs @@ -823,15 +823,35 @@ impl IpfsClient { /// Pins a new object. /// - /// Does not yet implement "progress" because reading it is kinda squirrelly. + /// The "recursive" option tells the server whether to + /// pin just the top-level object, or all sub-objects + /// it depends on. For most cases you want it to be `true`. /// + /// Does not yet implement the "progress" agument because + /// reading it is kinda squirrelly. + /// + /// # Examples + /// + /// ```no_run + /// # extern crate ipfs_api; + /// # extern crate tokio_core; + /// # + /// use ipfs_api::IpfsClient; + /// use tokio_core::reactor::Core; + /// + /// # fn main() { + /// let mut core = Core::new().unwrap(); + /// let client = IpfsClient::default(&core.handle()); + /// let req = client.pin_add("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", true); + /// # } + /// ``` #[inline] pub fn pin_add( &self, key: &str, - recursive: Option<bool> + recursive: bool ) -> AsyncResponse<response::PinAddResponse> { - self.request(&request::PinAdd { key, recursive, progress: false }, None) + self.request(&request::PinAdd { key, recursive: Some(recursive), progress: false }, None) } /// Returns a list of pinned objects in local storage. |