Trait ipfs_api_prelude::IpfsApi [−][src]
pub trait IpfsApi: Backend {
Show 98 methods
fn add<'life0, 'async_trait, R>(
&'life0 self,
data: R
) -> Pin<Box<dyn Future<Output = Result<AddResponse, Self::Error>> + 'async_trait>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: '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>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn add_path<'life0, 'async_trait, P>(
&'life0 self,
path: P
) -> Pin<Box<dyn Future<Output = Result<Vec<AddResponse>, Self::Error>> + 'async_trait>>
where
P: AsRef<Path>,
P: 'async_trait,
'life0: '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>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn bitswap_reprovide<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BitswapReprovideResponse, Self::Error>> + 'async_trait>>
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>>
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<BitswapUnwantResponse, Self::Error>> + 'async_trait>>
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>>
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> { ... }
fn block_put<'life0, 'async_trait, R>(
&'life0 self,
data: R
) -> Pin<Box<dyn Future<Output = Result<BlockPutResponse, Self::Error>> + 'async_trait>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: '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>>
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>>
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>>
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>>
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>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn cat(
&self,
path: &str
) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin> { ... }
fn commands<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<CommandsResponse, Self::Error>> + 'async_trait>>
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>>
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>>
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>>
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>>
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>>
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>>
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<ConfigEditResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn config_replace<'life0, 'async_trait, R>(
&'life0 self,
data: R
) -> Pin<Box<dyn Future<Output = Result<ConfigReplaceResponse, Self::Error>> + 'async_trait>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn config_show<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ConfigShowResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn dag_get(
&self,
path: &str
) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin> { ... }
fn dag_put<'life0, 'async_trait, R>(
&'life0 self,
data: R
) -> Pin<Box<dyn Future<Output = Result<DagPutResponse, Self::Error>> + 'async_trait>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn dht_findpeer(
&self,
peer: &str
) -> Box<dyn Stream<Item = Result<DhtFindPeerResponse, Self::Error>> + Unpin> { ... }
fn dht_findprovs(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtFindProvsResponse, Self::Error>> + Unpin> { ... }
fn dht_get(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtGetResponse, Self::Error>> + Unpin> { ... }
fn dht_provide(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtProvideResponse, Self::Error>> + Unpin> { ... }
fn dht_put(
&self,
key: &str,
value: &str
) -> Box<dyn Stream<Item = Result<DhtPutResponse, Self::Error>> + Unpin> { ... }
fn dht_query(
&self,
peer: &str
) -> Box<dyn Stream<Item = Result<DhtQueryResponse, Self::Error>> + Unpin> { ... }
fn diag_cmds_clear<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DiagCmdsClearResponse, Self::Error>> + 'async_trait>>
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<DiagCmdsSetTimeResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn diag_sys<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DiagSysResponse, Self::Error>> + 'async_trait>>
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>>
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>>
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<FilesCpResponse, Self::Error>> + 'async_trait>>
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<FilesCpResponse, Self::Error>> + 'async_trait>>
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<FilesFlushResponse, Self::Error>> + 'async_trait>>
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>>
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>>
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<FilesMkdirResponse, Self::Error>> + 'async_trait>>
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<FilesMkdirResponse, Self::Error>> + 'async_trait>>
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<FilesMvResponse, Self::Error>> + 'async_trait>>
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<FilesMvResponse, Self::Error>> + 'async_trait>>
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> { ... }
fn files_read_with_options(
&self,
options: FilesRead<'_>
) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin> { ... }
fn files_rm<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
recursive: bool
) -> Pin<Box<dyn Future<Output = Result<FilesRmResponse, Self::Error>> + 'async_trait>>
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<FilesRmResponse, Self::Error>> + 'async_trait>>
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>>
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>>
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<FilesWriteResponse, Self::Error>> + 'async_trait>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
'life1: '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<FilesWriteResponse, Self::Error>> + 'async_trait>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
'life1: '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<FilesChcidResponse, Self::Error>> + 'async_trait>>
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<FilesChcidResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn filestore_dups(
&self
) -> Box<dyn Stream<Item = Result<FilestoreDupsResponse, Self::Error>> + Unpin> { ... }
fn filestore_ls(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = Result<FilestoreLsResponse, Self::Error>> + Unpin> { ... }
fn filestore_verify(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = Result<FilestoreVerifyResponse, Self::Error>> + Unpin> { ... }
fn get(
&self,
path: &str
) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin> { ... }
fn id<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = Result<IdResponse, Self::Error>> + 'async_trait>>
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<KeyGenResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn key_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<KeyListResponse, Self::Error>> + 'async_trait>>
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>>
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<KeyRmResponse, Self::Error>> + 'async_trait>>
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>>
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>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn log_tail(
&self
) -> Box<dyn Stream<Item = Result<String, Self::Error>> + Unpin> { ... }
fn ls<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<LsResponse, Self::Error>> + 'async_trait>>
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> { ... }
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>>
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>>
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> { ... }
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>>
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>>
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>>
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>>
where
'life0: '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>>
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>>
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>>
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>>
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> { ... }
fn pubsub_ls<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<PubsubLsResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn pubsub_peers<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = Result<PubsubPeersResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
{ ... }
fn pubsub_pub<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 str,
payload: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<PubsubPubResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
{ ... }
fn pubsub_sub(
&self,
topic: &str,
discover: bool
) -> Box<dyn Stream<Item = Result<PubsubSubResponse, Self::Error>> + Unpin> { ... }
fn refs_local(
&self
) -> Box<dyn Stream<Item = Result<RefsLocalResponse, Self::Error>> + Unpin> { ... }
fn shutdown<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ShutdownResponse, Self::Error>> + 'async_trait>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn stats_bitswap<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StatsBitswapResponse, Self::Error>> + 'async_trait>>
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>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn stats_repo<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StatsRepoResponse, Self::Error>> + 'async_trait>>
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>>
where
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn swarm_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SwarmPeersResponse, Self::Error>> + 'async_trait>>
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>>
where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
{ ... }
fn tar_cat(
&self,
path: &str
) -> Box<dyn Stream<Item = Result<Bytes, Self::Error>> + Unpin> { ... }
fn version<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<VersionResponse, Self::Error>> + 'async_trait>>
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 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 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);
fn bitswap_ledger<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<BitswapLedgerResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the current ledger for a peer.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.bitswap_ledger("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ");
fn bitswap_reprovide<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BitswapReprovideResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn bitswap_reprovide<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BitswapReprovideResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Triggers a reprovide.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.bitswap_reprovide();
fn bitswap_stat<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BitswapStatResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns some stats about the bitswap agent.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.bitswap_stat();
fn bitswap_unwant<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<BitswapUnwantResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn bitswap_unwant<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<BitswapUnwantResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Remove a given block from your wantlist.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.bitswap_unwant("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
fn bitswap_wantlist<'life0, 'life1, 'async_trait>(
&'life0 self,
peer: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = Result<BitswapWantlistResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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);
Removes an IPFS block.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.block_rm("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
fn block_stat<'life0, 'life1, 'async_trait>(
&'life0 self,
hash: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<BlockStatResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Prints information about a raw IPFS block.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.block_stat("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
fn bootstrap_add_default<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BootstrapAddDefaultResponse, Self::Error>> + 'async_trait>> where
'life0: '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>> where
'life0: 'async_trait,
Self: 'async_trait,
Add default peers to the bootstrap list.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.bootstrap_add_default();
fn bootstrap_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BootstrapListResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Lists peers in bootstrap list.
Examples
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.bootstrap_list();
fn bootstrap_rm_all<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<BootstrapRmAllResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
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();
List available commands that the server accepts.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.commands();
fn config_get_string<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get ipfs config strings.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.config_get_string("Identity.PeerID");
fn config_get_bool<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get ipfs config booleans.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.config_get_bool("Datastore.HashOnRead");
fn config_get_json<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<ConfigResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get ipfs config json.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.config_get_json("Mounts");
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Set ipfs config string.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.config_set_string("Routing.Type", "dht");
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>> where
'life0: 'async_trait,
'life1: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Set ipfs config boolean.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.config_set_bool("Pubsub.DisableSigning", false);
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
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}}"#);
fn config_edit<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ConfigEditResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn config_edit<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ConfigEditResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
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);
fn config_show<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ConfigShowResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn config_show<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<ConfigShowResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
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();
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);
fn dht_findpeer(
&self,
peer: &str
) -> Box<dyn Stream<Item = Result<DhtFindPeerResponse, Self::Error>> + Unpin>
fn dht_findpeer(
&self,
peer: &str
) -> Box<dyn Stream<Item = Result<DhtFindPeerResponse, Self::Error>> + Unpin>
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<_>>();
fn dht_findprovs(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtFindProvsResponse, Self::Error>> + Unpin>
fn dht_findprovs(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtFindProvsResponse, Self::Error>> + Unpin>
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<_>>();
fn dht_provide(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtProvideResponse, Self::Error>> + Unpin>
fn dht_provide(
&self,
key: &str
) -> Box<dyn Stream<Item = Result<DhtProvideResponse, Self::Error>> + Unpin>
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<_>>();
fn diag_cmds_clear<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DiagCmdsClearResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn diag_cmds_clear<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<DiagCmdsClearResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Clear inactive requests from the log.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.diag_cmds_clear();
fn diag_cmds_set_time<'life0, 'life1, 'async_trait>(
&'life0 self,
time: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<DiagCmdsSetTimeResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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<DiagCmdsSetTimeResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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");
fn files_cp_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
options: FilesCp<'life1>
) -> Pin<Box<dyn Future<Output = Result<FilesCpResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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<FilesCpResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Copy files into MFS.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.files_cp("/path/to/file", "/dest");
fn files_flush<'life0, 'life1, 'async_trait>(
&'life0 self,
path: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = Result<FilesFlushResponse, Self::Error>> + 'async_trait>> 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<FilesFlushResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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"));
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>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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.
fn files_mkdir<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
parents: bool
) -> Pin<Box<dyn Future<Output = Result<FilesMkdirResponse, Self::Error>> + 'async_trait>> 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<FilesMkdirResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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);
fn files_mkdir_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
options: FilesMkdir<'life1>
) -> Pin<Box<dyn Future<Output = Result<FilesMkdirResponse, Self::Error>> + 'async_trait>> 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<FilesMkdirResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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");
fn files_mv_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
options: FilesMv<'life1>
) -> Pin<Box<dyn Future<Output = Result<FilesMvResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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<FilesMvResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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);
fn files_rm_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
options: FilesRm<'life1>
) -> Pin<Box<dyn Future<Output = Result<FilesRmResponse, Self::Error>> + 'async_trait>> 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<FilesRmResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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);
fn files_stat<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<FilesStatResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Display a file’s status in MFS.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.files_stat("/test/file.json");
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>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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),
}
);
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<FilesWriteResponse, Self::Error>> + 'async_trait>> where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'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<FilesWriteResponse, Self::Error>> + 'async_trait>> where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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);
fn files_write_with_options<'life0, 'life1, 'async_trait, R>(
&'life0 self,
options: FilesWrite<'life1>,
data: R
) -> Pin<Box<dyn Future<Output = Result<FilesWriteResponse, Self::Error>> + 'async_trait>> where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
'life1: '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<FilesWriteResponse, Self::Error>> + 'async_trait>> where
R: 'static + Read + Send + Sync,
R: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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);
fn files_chcid<'life0, 'life1, 'async_trait>(
&'life0 self,
path: &'life1 str,
cid_version: i32
) -> Pin<Box<dyn Future<Output = Result<FilesChcidResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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<FilesChcidResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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.
fn files_chcid_with_options<'life0, 'life1, 'async_trait>(
&'life0 self,
options: FilesChcid<'life1>
) -> Pin<Box<dyn Future<Output = Result<FilesChcidResponse, Self::Error>> + 'async_trait>> 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<FilesChcidResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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.
fn filestore_dups(
&self
) -> Box<dyn Stream<Item = Result<FilestoreDupsResponse, Self::Error>> + Unpin>
fn filestore_dups(
&self
) -> Box<dyn Stream<Item = Result<FilestoreDupsResponse, Self::Error>> + Unpin>
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();
fn filestore_ls(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = Result<FilestoreLsResponse, Self::Error>> + Unpin>
fn filestore_ls(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = Result<FilestoreLsResponse, Self::Error>> + Unpin>
List objects in filestore.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.filestore_ls(
Some("QmYPP3BovR2m8UqCZxFbdXSit6SKgExxDkFAPLqiGsap4X")
);
fn filestore_verify(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = Result<FilestoreVerifyResponse, Self::Error>> + Unpin>
fn filestore_verify(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = Result<FilestoreVerifyResponse, Self::Error>> + Unpin>
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();
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
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");
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>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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");
fn ls_with_options(
&self,
options: Ls<'_>
) -> Box<dyn Stream<Item = Result<LsResponse, Self::Error>> + Unpin>
fn ls_with_options(
&self,
options: Ls<'_>
) -> Box<dyn Stream<Item = Result<LsResponse, Self::Error>> + Unpin>
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()
);
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),
});
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
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");
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
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>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
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"
);
fn object_get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<ObjectGetResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the data in an object.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.object_get("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
fn object_links<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<ObjectLinksResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the links that an object points to.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.object_links("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
fn object_new<'life0, 'async_trait>(
&'life0 self,
template: Option<ObjectTemplate>
) -> Pin<Box<dyn Future<Output = Result<ObjectNewResponse, Self::Error>> + 'async_trait>> where
'life0: '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>> where
'life0: 'async_trait,
Self: 'async_trait,
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));
fn object_stat<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<ObjectStatResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: '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>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
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();
fn pubsub_peers<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = Result<PubsubPeersResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn pubsub_peers<'life0, 'life1, 'async_trait>(
&'life0 self,
topic: Option<&'life1 str>
) -> Pin<Box<dyn Future<Output = Result<PubsubPeersResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
List peers that are being published to.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.pubsub_peers(None);
let res = client.pubsub_peers(Some("feed"));
fn pubsub_pub<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 str,
payload: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<PubsubPubResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn pubsub_pub<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
topic: &'life1 str,
payload: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<PubsubPubResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Publish a message to a topic.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.pubsub_pub("feed", "Hello World!");
fn pubsub_sub(
&self,
topic: &str,
discover: bool
) -> Box<dyn Stream<Item = Result<PubsubSubResponse, Self::Error>> + Unpin>
fn pubsub_sub(
&self,
topic: &str,
discover: bool
) -> Box<dyn Stream<Item = Result<PubsubSubResponse, Self::Error>> + Unpin>
Subscribes to a pubsub topic.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.pubsub_sub("feed", false);
let res = client.pubsub_sub("feed", true);
fn refs_local(
&self
) -> Box<dyn Stream<Item = Result<RefsLocalResponse, Self::Error>> + Unpin>
fn refs_local(
&self
) -> Box<dyn Stream<Item = Result<RefsLocalResponse, Self::Error>> + Unpin>
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();
fn stats_bitswap<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StatsBitswapResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn stats_bitswap<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StatsBitswapResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
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();
fn stats_repo<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StatsRepoResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn stats_repo<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<StatsRepoResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns repo stats.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.stats_repo();
fn swarm_addrs_local<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SwarmAddrsLocalResponse, Self::Error>> + 'async_trait>> 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>> where
'life0: 'async_trait,
Self: 'async_trait,
Return a list of local addresses.
use ipfs_api::{IpfsApi, IpfsClient};
let client = IpfsClient::default();
let res = client.swarm_addrs_local();
fn swarm_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SwarmPeersResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn swarm_peers<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<SwarmPeersResponse, Self::Error>> + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
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();