Trait ipfs_api::IpfsApi

pub trait IpfsApi: Backend {
Show 107 methods fn add<'life0, 'async_trait, R>(
        &'life0 self,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<AddResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn add_async<'life0, 'async_trait, R>(
        &'life0 self,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<AddResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + AsyncRead + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn add_with_options<'life0, 'life1, 'async_trait, R>(
        &'life0 self,
        data: R,
        add: Add<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<AddResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn add_async_with_options<'life0, 'life1, 'async_trait, R>(
        &'life0 self,
        data: R,
        add: Add<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<AddResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        R: 'static + AsyncRead + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn add_with_form<'life0, 'life1, 'async_trait, F>(
        &'life0 self,
        form: F,
        add: Add<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<Vec<AddResponse, Global>, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        F: Into<Form<'static>> + Send + 'async_trait,
        Self: 'async_trait
, { ... } fn add_path<'life0, 'async_trait, P>(
        &'life0 self,
        path: P
    ) -> Pin<Box<dyn Future<Output = Result<Vec<AddResponse, Global>, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        P: AsRef<Path> + Send + 'async_trait,
        Self: 'async_trait
, { ... } fn bitswap_ledger<'life0, 'life1, 'async_trait>(
        &'life0 self,
        peer: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<BitswapLedgerResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn bitswap_reprovide<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn bitswap_stat<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<BitswapStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn bitswap_unwant<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn bitswap_wantlist<'life0, 'life1, 'async_trait>(
        &'life0 self,
        peer: Option<&'life1 str>
    ) -> Pin<Box<dyn Future<Output = Result<BitswapWantlistResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn block_get(
        &self,
        hash: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn block_put<'life0, 'async_trait, R>(
        &'life0 self,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<BlockPutResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn block_put_with_options<'life0, 'async_trait, R>(
        &'life0 self,
        data: R,
        options: BlockPut<'async_trait>
    ) -> Pin<Box<dyn Future<Output = Result<BlockPutResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn block_rm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hash: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<BlockRmResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn block_stat<'life0, 'life1, 'async_trait>(
        &'life0 self,
        hash: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<BlockStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn bootstrap_add_default<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<BootstrapAddDefaultResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn bootstrap_list<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<BootstrapListResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn bootstrap_rm_all<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<BootstrapRmAllResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn cat(
        &self,
        path: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn cat_range(
        &self,
        path: &str,
        _offset: usize,
        _length: usize
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn commands<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<CommandsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn config_get_string<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn config_get_bool<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn config_get_json<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn config_set_string<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        value: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn config_set_bool<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        value: bool
    ) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn config_set_json<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        value: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn config_edit<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn config_replace<'life0, 'async_trait, R>(
        &'life0 self,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn config_show<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn dag_get(
        &self,
        path: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn dag_get_with_options(
        &self,
        options: DagGet<'_>
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn dag_put<'life0, 'async_trait, R>(
        &'life0 self,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<DagPutResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn dag_put_with_options<'a, 'life0, 'async_trait, R>(
        &'life0 self,
        data: R,
        options: DagPut<'a>
    ) -> Pin<Box<dyn Future<Output = Result<DagPutResponse, Self::Error>> + 'async_trait, Global>>
    where
        'a: 'async_trait,
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn dht_findpeer(
        &self,
        peer: &str
    ) -> Box<dyn Stream<Item = Result<DhtMessage, Self::Error>> + Unpin + 'static, Global> { ... } fn dht_findprovs(
        &self,
        key: &str
    ) -> Box<dyn Stream<Item = Result<DhtMessage, Self::Error>> + Unpin + 'static, Global> { ... } fn dht_get(
        &self,
        key: &str
    ) -> Box<dyn Stream<Item = Result<DhtMessage, Self::Error>> + Unpin + 'static, Global> { ... } fn dht_provide(
        &self,
        key: &str
    ) -> Box<dyn Stream<Item = Result<DhtMessage, Self::Error>> + Unpin + 'static, Global> { ... } fn dht_put(
        &self,
        key: &str,
        value: &str
    ) -> Box<dyn Stream<Item = Result<DhtMessage, Self::Error>> + Unpin + 'static, Global> { ... } fn dht_query(
        &self,
        peer: &str
    ) -> Box<dyn Stream<Item = Result<DhtMessage, Self::Error>> + Unpin + 'static, Global> { ... } fn diag_cmds_clear<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn diag_cmds_set_time<'life0, 'life1, 'async_trait>(
        &'life0 self,
        time: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn diag_sys<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<String, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn dns<'life0, 'life1, 'async_trait>(
        &'life0 self,
        link: &'life1 str,
        recursive: bool
    ) -> Pin<Box<dyn Future<Output = Result<DnsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn file_ls<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<FileLsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_cp<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        dest: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn files_cp_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesCp<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_flush<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: Option<&'life1 str>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_ls<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: Option<&'life1 str>
    ) -> Pin<Box<dyn Future<Output = Result<FilesLsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_ls_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesLs<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<FilesLsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_mkdir<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        parents: bool
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_mkdir_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesMkdir<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_mv<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        dest: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn files_mv_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesMv<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_read(
        &self,
        path: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn files_read_with_options(
        &self,
        options: FilesRead<'_>
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn files_rm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        recursive: bool
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_rm_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesRm<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_stat<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<FilesStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_stat_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesStat<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<FilesStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_write<'life0, 'life1, 'async_trait, R>(
        &'life0 self,
        path: &'life1 str,
        create: bool,
        truncate: bool,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn files_write_with_options<'life0, 'life1, 'async_trait, R>(
        &'life0 self,
        options: FilesWrite<'life1>,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn files_chcid<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        cid_version: i32
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn files_chcid_with_options<'life0, 'life1, 'async_trait>(
        &'life0 self,
        options: FilesChcid<'life1>
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn filestore_dups(
        &self
    ) -> Box<dyn Stream<Item = Result<FilestoreDupsResponse, Self::Error>> + Unpin + 'static, Global> { ... } fn filestore_ls(
        &self,
        cid: Option<&str>
    ) -> Box<dyn Stream<Item = Result<FilestoreObject, Self::Error>> + Unpin + 'static, Global> { ... } fn filestore_verify(
        &self,
        cid: Option<&str>
    ) -> Box<dyn Stream<Item = Result<FilestoreObject, Self::Error>> + Unpin + 'static, Global> { ... } fn get(
        &self,
        path: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        peer: Option<&'life1 str>
    ) -> Pin<Box<dyn Future<Output = Result<IdResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn key_gen<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        kind: KeyType,
        size: i32
    ) -> Pin<Box<dyn Future<Output = Result<KeyPair, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn key_list<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<KeyPairList, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn key_rename<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        name: &'life1 str,
        new: &'life2 str,
        force: bool
    ) -> Pin<Box<dyn Future<Output = Result<KeyRenameResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn key_rm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<KeyPairList, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn log_level<'life0, 'life1, 'async_trait>(
        &'life0 self,
        logger: Logger<'life1>,
        level: LoggingLevel
    ) -> Pin<Box<dyn Future<Output = Result<LogLevelResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn log_ls<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<LogLsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn log_tail(
        &self
    ) -> Box<dyn Stream<Item = Result<String, Self::Error>> + Unpin + 'static, Global> { ... } fn ls<'life0, 'life1, 'async_trait>(
        &'life0 self,
        path: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<LsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn ls_with_options(
        &self,
        options: Ls<'_>
    ) -> Box<dyn Stream<Item = Result<LsResponse, Self::Error>> + Unpin + 'static, Global> { ... } fn name_publish<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
        &'life0 self,
        path: &'life1 str,
        resolve: bool,
        lifetime: Option<&'life2 str>,
        ttl: Option<&'life3 str>,
        key: Option<&'life4 str>
    ) -> Pin<Box<dyn Future<Output = Result<NamePublishResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        'life4: 'async_trait,
        Self: 'async_trait
, { ... } fn name_resolve<'life0, 'life1, 'async_trait>(
        &'life0 self,
        name: Option<&'life1 str>,
        recursive: bool,
        nocache: bool
    ) -> Pin<Box<dyn Future<Output = Result<NameResolveResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn object_data(
        &self,
        key: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn object_diff<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key0: &'life1 str,
        key1: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<ObjectDiffResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn object_get<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<ObjectGetResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn object_links<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<ObjectLinksResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn object_new<'life0, 'async_trait>(
        &'life0 self,
        template: Option<ObjectTemplate>
    ) -> Pin<Box<dyn Future<Output = Result<ObjectNewResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn object_patch_add_link<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        folder: &'life1 str,
        name: &'life2 str,
        key: &'life3 str,
        create: bool
    ) -> Pin<Box<dyn Future<Output = Result<ObjectPatchAddLinkResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        'life3: 'async_trait,
        Self: 'async_trait
, { ... } fn object_stat<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<ObjectStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn pin_add<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        recursive: bool
    ) -> Pin<Box<dyn Future<Output = Result<PinAddResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn pin_ls<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        key: Option<&'life1 str>,
        typ: Option<&'life2 str>
    ) -> Pin<Box<dyn Future<Output = Result<PinLsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
, { ... } fn pin_rm<'life0, 'life1, 'async_trait>(
        &'life0 self,
        key: &'life1 str,
        recursive: bool
    ) -> Pin<Box<dyn Future<Output = Result<PinRmResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn ping(
        &self,
        peer: &str,
        count: Option<i32>
    ) -> Box<dyn Stream<Item = Result<PingResponse, Self::Error>> + Unpin + 'static, Global> { ... } fn pubsub_ls<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<PubsubLsResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn pubsub_peers<'life0, 'async_trait, T>(
        &'life0 self,
        topic: Option<T>
    ) -> Pin<Box<dyn Future<Output = Result<PubsubPeersResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        T: AsRef<[u8]> + Send + Sync + 'async_trait,
        Self: 'async_trait
, { ... } fn pubsub_pub<'life0, 'async_trait, T, R>(
        &'life0 self,
        topic: T,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        T: AsRef<[u8]> + Send + Sync + 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn pubsub_sub<T>(
        &self,
        topic: T
    ) -> Box<dyn Stream<Item = Result<PubsubSubResponse, Self::Error>> + Unpin + 'static, Global>
    where
        T: AsRef<[u8]>
, { ... } fn refs_local(
        &self
    ) -> Box<dyn Stream<Item = Result<RefsLocalResponse, Self::Error>> + Unpin + 'static, Global> { ... } fn shutdown<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn stats_bitswap<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<BitswapStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn stats_bw<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<StatsBwResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn stats_repo<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<RepoStatResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn swarm_addrs_local<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<SwarmAddrsLocalResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn swarm_connect<'life0, 'life1, 'async_trait>(
        &'life0 self,
        peer: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<SwarmConnectResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
, { ... } fn swarm_peers<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<SwarmPeersResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... } fn tar_add<'life0, 'async_trait, R>(
        &'life0 self,
        data: R
    ) -> Pin<Box<dyn Future<Output = Result<TarAddResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        R: 'static + Read + Send + Sync + Unpin + 'async_trait,
        Self: 'async_trait
, { ... } fn tar_cat(
        &self,
        path: &str
    ) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin + 'static, Global> { ... } fn version<'life0, 'async_trait>(
        &'life0 self
    ) -> Pin<Box<dyn Future<Output = Result<VersionResponse, Self::Error>> + 'async_trait, Global>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
, { ... }
}

Provided Methods§

Add file to Ipfs.

Examples
use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let data = Cursor::new("Hello World!");
let res = client.add(data);

Add AsyncRead stream to Ipfs.

Examples
use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let data = b"Hello World!";
let res = client.add_async(&data[..]);

Add a file to IPFS with options.

Examples
use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let data = Cursor::new("Hello World!");
#[cfg(feature = "with-builder")]
let add = ipfs_api::request::Add::builder()
    .chunker("rabin-512-1024-2048")
    .build();
#[cfg(not(feature = "with-builder"))]
let add = ipfs_api::request::Add {
    chunker: Some("rabin-512-1024-2048"),
    ..Default::default()
};
let req = client.add_with_options(data, add);

Add AsyncRead stream to IPFS with options.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let data = b"Hello World!";
#[cfg(feature = "with-builder")]
let add = ipfs_api::request::Add::builder()
    .chunker("rabin-512-1024-2048")
    .build();
#[cfg(not(feature = "with-builder"))]
let add = ipfs_api::request::Add {
    chunker: Some("rabin-512-1024-2048"),
    ..Default::default()
};
let req = client.add_async_with_options(&data[..], add);

Add files using multipart::Form

Examples
use ipfs_api::{IpfsApi, IpfsClient, Form};
use common_multipart_rfc7578::client::multipart;
use std::io::Cursor;

#[cfg(feature = "with-builder")]
let add = ipfs_api::request::Add::builder()
    .wrap_with_directory(true)
    .build();
#[cfg(not(feature = "with-builder"))]
let add = ipfs_api::request::Add {
    wrap_with_directory: Some(true),
    ..Default::default()
};

let mut form = Form::default();
form.add_reader_file("path", Cursor::new(Vec::new()), "file.txt");

let client = IpfsClient::default();
let res = client.add_with_form(form, add);

Add a path to Ipfs. Can be a file or directory. A hard limit of 128 open file descriptors is set such that any small additional files are stored in-memory.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let path = "./src";
let res = client.add_path(path);

Returns the current ledger for a peer.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bitswap_ledger("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ");

Triggers a reprovide.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bitswap_reprovide();

Returns some stats about the bitswap agent.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bitswap_stat();

Remove a given block from your wantlist.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bitswap_unwant("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");

Shows blocks on the wantlist for you or the specified peer.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bitswap_wantlist(
    Some("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ")
);

Gets a raw IPFS block.

Examples
use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let res = client
    .block_get(hash)
    .map_ok(|chunk| chunk.to_vec())
    .try_concat();

Store input as an IPFS block.

Examples
use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let data = Cursor::new("Hello World!");
let res = client.block_put(data);

Store input as an IPFS block with options.

Examples
use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

#[cfg(feature = "with-builder")]
let options = ipfs_api::request::BlockPut::builder()
    .mhtype("sha3_384")
    .mhlen(48)
    .build();
#[cfg(not(feature = "with-builder"))]
let options = ipts_api::request::BlockPut {
    mhtype: "sha3_384",
    mhlen: 48,
    ..Default::default()
};
let client = IpfsClient::default();
let data = Cursor::new("Hello World!");
let res = client.block_put_with_options(data, options);

Removes an IPFS block.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.block_rm("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");

Prints information about a raw IPFS block.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.block_stat("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");

Add default peers to the bootstrap list.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bootstrap_add_default();

Lists peers in bootstrap list.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bootstrap_list();

Removes all peers in bootstrap list.

Examples
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.bootstrap_rm_all();

Returns the contents of an Ipfs object.

Examples
use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let res = client
    .cat(hash)
    .map_ok(|chunk| chunk.to_vec())
    .try_concat();

Returns the the specified range of bytes of an Ipfs object.

Examples
use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let offset = 0;
let length = 10;

let res = client
    .cat_range(hash, offset, length)
    .map_ok(|chunk| chunk.to_vec())
    .try_concat();

List available commands that the server accepts.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.commands();

Get ipfs config strings.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_get_string("Identity.PeerID");

Get ipfs config booleans.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_get_bool("Datastore.HashOnRead");

Get ipfs config json.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_get_json("Mounts");

Set ipfs config string.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_set_string("Routing.Type", "dht");

Set ipfs config boolean.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_set_bool("Pubsub.DisableSigning", false);

Set ipfs config json.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_set_json("Discovery", r#"{"MDNS":{"Enabled":true,"Interval":10}}"#);

Opens the config file for editing (on the server).

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_edit();

Replace the config file.

use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let config = Cursor::new("{..json..}");
let res = client.config_replace(config);

Show the current config of the server.

Returns an unparsed json string, due to an unclear spec.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.config_show();

Returns information about a dag node in Ipfs.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let res = client
    .dag_get(hash)
    .map_ok(|chunk| chunk.to_vec())
    .try_concat();

Returns information about a dag node in Ipfs with options.

use futures::TryStreamExt;
use ipfs_api::{request::{DagCodec, DagGet}, IpfsApi, IpfsClient};

let client = IpfsClient::default();
let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
#[cfg(feature = "with-builder")]
let options = DagGet::builder().path(hash).codec(DagCodec::Cbor).build();
#[cfg(not(feature = "with-builder"))]
let options = DagGet {
    path: hash,
    codec: DagCodec::Cbor,
};
client.dag_get_with_options(options)
    .map_ok(|chunk| chunk.to_vec())
    .try_concat();

Add a DAG node to Ipfs.

use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let data = Cursor::new(r#"{ "hello" : "world" }"#);
let res = client.dag_put(data);

Add a DAG node to Ipfs with options.

use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;
use ipfs_api::request::{DagCodec, DagPut};

let client = IpfsClient::default();
let data = Cursor::new(r#"{ "hello" : "world" }"#);
let dag_put = DagPut::builder()
    .input_codec(DagCodec::Json)
    .pin(false)
    .build();
let res = client.dag_put_with_options(data, dag_put);

Query the DHT for all of the multiaddresses associated with a Peer ID.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let peer = "QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM";
let res = client.dht_findpeer(peer).try_collect::<Vec<_>>();

Find peers in the DHT that can provide a specific value given a key.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let key = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let res = client.dht_findprovs(key).try_collect::<Vec<_>>();

Query the DHT for a given key.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let key = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let res = client.dht_get(key).try_collect::<Vec<_>>();

Announce to the network that you are providing a given value.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let key = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA";
let res = client.dht_provide(key).try_collect::<Vec<_>>();

Write a key/value pair to the DHT.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.dht_put("test", "Hello World!").try_collect::<Vec<_>>();

Find the closest peer given the peer ID by querying the DHT.

use futures::TryStreamExt;
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let peer = "QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM";
let res = client.dht_query(peer).try_collect::<Vec<_>>();

Clear inactive requests from the log.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.diag_cmds_clear();

Set how long to keep inactive requests in the log.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.diag_cmds_set_time("1m");

Print system diagnostic information.

Note: There isn’t good documentation on what this call is supposed to return. It might be platform dependent, but if it isn’t, this can be fixed to return an actual object.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.diag_sys();

Resolve DNS link.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.dns("ipfs.io", true);

List directory for Unix filesystem objects.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.file_ls("/ipns/ipfs.io");

Copy files into MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_cp("/path/to/file", "/dest");

Copy files into MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_cp("/path/to/file", "/dest");

Flush a path’s data to disk.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_flush(None);
let res = client.files_flush(Some("/tmp"));

List directories in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_ls(None);
let res = client.files_ls(Some("/tmp"));

List directories in MFS..

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
#[cfg(feature = "with-builder")]
let req = ipfs_api::request::FilesLs::builder()
    // .path("/") // defaults to /
    .unsorted(false)
    .long(true)
    .build();
#[cfg(not(feature = "with-builder"))]
let req = ipfs_api::request::FilesLs {
    path: None, // defaults to /
    unsorted: Some(false),
    long: Some(true),
};
let res = client.files_ls_with_options(req);

Defaults to -U, so the output is unsorted.

Make directories in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_mkdir("/test", false);
let res = client.files_mkdir("/test/nested/dir", true);

Make directories in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
#[cfg(feature = "with-builder")]
let req = ipfs_api::request::FilesMkdir::builder()
    .path("/test/nested/dir")
    .parents(true)
    .flush(false)
    .build();
#[cfg(not(feature = "with-builder"))]
let req = ipfs_api::request::FilesMkdir {
    path: "/test/nested/dir",
    parents: Some(true),
    flush: Some(false),
    .. Default::default()
};
let res = client.files_mkdir_with_options(req);

Copy files into MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_mv("/test/tmp.json", "/test/file.json");

Copy files into MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_mv_with_options(
    ipfs_api::request::FilesMv {
        path: "/test/tmp.json",
        dest: "/test/file.json",
        flush: Some(false),
    }
);

Read a file in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_read("/test/file.json");

Read a file in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
#[cfg(feature = "with-builder")]
let req = ipfs_api::request::FilesRead::builder()
    .path("/test/file.json")
    .offset(1024)
    .count(8)
    .build();
#[cfg(not(feature = "with-builder"))]
let req = ipfs_api::request::FilesRead {
    path: "/test/file.json",
    offset: Some(1024),
    count: Some(8),
};
let res = client.files_read_with_options(req);

Remove a file in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_rm("/test/dir", true);
let res = client.files_rm("/test/file.json", false);

Remove a file in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
#[cfg(feature = "with-builder")]
let req = ipfs_api::request::FilesRm::builder()
    .path("/test/somefile.json")
    .recursive(false)
    .flush(false)
    .build();
#[cfg(not(feature = "with-builder"))]
let req = ipfs_api::request::FilesRm {
    path: "/test/somefile.json",
    recursive: Some(false),
    flush: Some(false),
};
let res = client.files_rm_with_options(req);

Display a file’s status in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_stat("/test/file.json");

Display a file’s status in MFS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.files_stat_with_options(
    ipfs_api::request::FilesStat {
        path: "/test/dir/",
        with_local: Some(true),
    }
);

Write to a mutable file in the filesystem.

use ipfs_api::{IpfsApi, IpfsClient};
use std::fs::File;

let client = IpfsClient::default();
let file = File::open("test.json").unwrap();
let res = client.files_write("/test/file.json", true, true, file);

Write to a mutable file in the filesystem.

use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let data = Cursor::new((1..128).collect::<Vec<u8>>());
#[cfg(feature = "with-builder")]
let req = ipfs_api::request::FilesWrite::builder()
    .path("/test/outfile.bin")
    .create(false)
    .truncate(false)
    .offset(1 << 20)
    .flush(false)
    // see FilesWriteBuilder for the full set of options
    .build();
#[cfg(not(feature = "with-builder"))]
let req = ipfs_api::request::FilesWrite {
    path: "/test/outfile.bin",
    create: Some(false),
    truncate: Some(false),
    offset: Some(1 << 20),
    flush: Some(false),
    .. Default::default()
};
let res = client.files_write_with_options(req, data);

Change the cid version or hash function of the root node of a given path.

use ipfs_api::{IpfsApi, IpfsClient};
use std::fs::File;

let client = IpfsClient::default();
let res = client.files_chcid("/test/", 1);

Not specifying a byte count writes the entire input.

Change the cid version or hash function of the root node of a given path.

use ipfs_api::{IpfsApi, IpfsClient};
use std::fs::File;

let client = IpfsClient::default();
#[cfg(feature = "with-builder")]
let req = ipfs_api::request::FilesChcid::builder()
    .path("/test/")
    .cid_version(1)
    .hash("sha3-512")
    .flush(true)
    .build();
#[cfg(not(feature = "with-builder"))]
let req = ipfs_api::request::FilesChcid {
    path: Some("/test/"),
    cid_version: Some(1),
    hash: Some("sha3-512"),
    flush: Some(false),
};
let res = client.files_chcid_with_options(req);

Not specifying a byte count writes the entire input.

List blocks that are both in the filestore and standard block storage.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.filestore_dups();

List objects in filestore.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.filestore_ls(
    Some("QmYPP3BovR2m8UqCZxFbdXSit6SKgExxDkFAPLqiGsap4X")
);

Verify objects in filestore.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.filestore_verify(None);

Download Ipfs object.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.get("/test/file.json");

Returns information about a peer.

If peer is None, returns information about you.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.id(None);
let res = client.id(Some("QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM"));

Create a new keypair.

use ipfs_api::{IpfsApi, IpfsClient, KeyType};

let client = IpfsClient::default();
let res = client.key_gen("test", KeyType::Rsa, 64);

List all local keypairs.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.key_list();

Rename a keypair.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.key_rename("key_0", "new_name", false);

Remove a keypair.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.key_rm("key_0");

Change the logging level for a logger.

use ipfs_api::{IpfsApi, IpfsClient, Logger, LoggingLevel};
use std::borrow::Cow;

let client = IpfsClient::default();
let res = client.log_level(Logger::All, LoggingLevel::Debug);
let res = client.log_level(
    Logger::Specific(Cow::Borrowed("web")),
    LoggingLevel::Warning
);

List all logging subsystems.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.log_ls();

Read the event log.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.log_tail();

List the contents of an Ipfs multihash.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.ls("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");

List the contents of an Ipfs multihash.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
#[cfg(feature = "with-builder")]
let _ = client.ls_with_options(ipfs_api::request::Ls::builder()
    .path("/ipfs/QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n")
    .build()
);
#[cfg(not(feature = "with-builder"))]
let _ = client.ls_with_options(ipfs_api::request::Ls {
    path: "/ipfs/QmdfTbBqBPQ7VNxZEYEj14VmRuZBkqFbiwReogJgS1zR1n",
    // Example options for fast listing
    stream: Some(true),
    resolve_type: Some(false),
    size: Some(false),
});

Publish an IPFS path to IPNS.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.name_publish(
    "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY",
    false,
    Some("12h"),
    None,
    None
);

Resolve an IPNS name.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.name_resolve(
    Some("/ipns/ipfs.io"),
    true,
    false
);

Output the raw bytes of an Ipfs object.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.object_data("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");

Returns the diff of two Ipfs objects.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.object_diff(
    "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY",
    "/ipfs/QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA"
);

Returns the data in an object.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.object_get("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");

Returns the links that an object points to.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.object_links("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");

Create a new object.

use ipfs_api::{IpfsApi, IpfsClient, ObjectTemplate};

let client = IpfsClient::default();
let res = client.object_new(None);
let res = client.object_new(Some(ObjectTemplate::UnixFsDir));

Add a directory link to an object.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.object_patch_add_link(
    "QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn",
    "hello_world.txt",
    "QmfM2r8seH2GiRaC4esTjeraXEachRt8ZsSeGaWTPLyMoG",
    false
);
let res = client.object_patch_add_link(
    "QmcXu68EVrtSEQ8SoPCWAfKJ9JqY6jnZyyiizRwksnt3kv",
    "hello/dad.txt",
    "Qma1UVHKYFkk6cGo3V1VmyMxRb1Bpd9SBbXdZURk28VtND",
    true
);

Returns the stats for an object.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.object_stat("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");

Pins a new object.

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
use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.pin_add("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", true);

Returns a list of pinned objects in local storage.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.pin_ls(None, None);
let res = client.pin_ls(
    Some("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY"),
    None
);
let res = client.pin_ls(None, Some("direct"));

Removes a pinned object from local storage.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.pin_rm(
    "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY",
    false
);
let res = client.pin_rm(
    "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY",
    true
);

Pings a peer.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.ping("QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", None);
let res = client.ping("QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", Some(15));

List subscribed pubsub topics.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.pubsub_ls();

List peers that are being published to.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.pubsub_peers(Option::<String>::None);
let res = client.pubsub_peers(Some("feed"));

Publish a message to a topic.

use ipfs_api::{IpfsApi, IpfsClient};
use std::io::Cursor;

let client = IpfsClient::default();
let res = client.pubsub_pub("feed", Cursor::new("Hello World!"));

Subscribes to a pubsub topic.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.pubsub_sub("feed");
let res = client.pubsub_sub("feed");

Gets a list of local references.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.refs_local();

Shutdown the Ipfs daemon.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.shutdown();

Returns bitswap stats.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.stats_bitswap();

Returns bandwidth stats.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.stats_bw();

Returns repo stats.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.stats_repo();

Return a list of local addresses.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.swarm_addrs_local();

Connect to a given peer

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.swarm_connect("/dns4/production-ipfs-cluster-us-east-1-node2.runfission.com/tcp/4003/wss/p2p/12D3KooWQ2hL9NschcJ1Suqa1TybJc2ZaacqoQMBT3ziFC7Ye2BZ");

Return a list of peers with open connections.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.swarm_peers();

Add a tar file to Ipfs.

Note: data should already be a tar file. If it isn’t the Api will return an error.

use ipfs_api::{IpfsApi, IpfsClient};
use std::fs::File;

let client = IpfsClient::default();
let tar = File::open("/path/to/file.tar").unwrap();
let res = client.tar_add(tar);

Export a tar file from Ipfs.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.tar_cat("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");

Returns information about the Ipfs server version.

use ipfs_api::{IpfsApi, IpfsClient};

let client = IpfsClient::default();
let res = client.version();

Implementors§