[−][src]Struct ipfs_api::IpfsClient
Asynchronous Ipfs client.
Methods
impl IpfsClient
[src]
pub fn new(host: &str, port: u16) -> Result<IpfsClient, InvalidUri>
[src]
Creates a new IpfsClient
.
impl IpfsClient
[src]
pub fn add<R>(
&self,
data: R
) -> Box<dyn Future<Item = AddResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
&self,
data: R
) -> Box<dyn Future<Item = AddResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
Add file to Ipfs.
Examples
use ipfs_api::IpfsClient; use std::io::Cursor; let client = IpfsClient::default(); let data = Cursor::new("Hello World!"); let req = client.add(data);
pub fn add_path<P>(
&self,
path: P
) -> Box<dyn Future<Item = AddResponse, Error = Error> + Send + 'static> where
P: AsRef<Path>,
[src]
&self,
path: P
) -> Box<dyn Future<Item = AddResponse, Error = Error> + Send + 'static> where
P: AsRef<Path>,
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::IpfsClient; let client = IpfsClient::default(); let path = "./src"; let req = client.add_path(path);
pub fn bitswap_ledger(
&self,
peer: &str
) -> Box<dyn Future<Item = BitswapLedgerResponse, Error = Error> + Send + 'static>
[src]
&self,
peer: &str
) -> Box<dyn Future<Item = BitswapLedgerResponse, Error = Error> + Send + 'static>
Returns the current ledger for a peer.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bitswap_ledger("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ");
pub fn bitswap_reprovide(
&self
) -> Box<dyn Future<Item = BitswapReprovideResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = BitswapReprovideResponse, Error = Error> + Send + 'static>
Triggers a reprovide.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bitswap_reprovide();
pub fn bitswap_stat(
&self
) -> Box<dyn Future<Item = BitswapStatResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = BitswapStatResponse, Error = Error> + Send + 'static>
Returns some stats about the bitswap agent.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bitswap_stat();
pub fn bitswap_unwant(
&self,
key: &str
) -> Box<dyn Future<Item = BitswapUnwantResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Future<Item = BitswapUnwantResponse, Error = Error> + Send + 'static>
Remove a given block from your wantlist.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bitswap_unwant("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
pub fn bitswap_wantlist(
&self,
peer: Option<&str>
) -> Box<dyn Future<Item = BitswapWantlistResponse, Error = Error> + Send + 'static>
[src]
&self,
peer: Option<&str>
) -> Box<dyn Future<Item = BitswapWantlistResponse, Error = Error> + Send + 'static>
Shows blocks on the wantlist for you or the specified peer.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bitswap_wantlist(Some("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"));
pub fn block_get(
&self,
hash: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
[src]
&self,
hash: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
Gets a raw IPFS block.
Examples
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA"; let req = client.block_get(hash).concat2();
pub fn block_put<R>(
&self,
data: R
) -> Box<dyn Future<Item = BlockPutResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
&self,
data: R
) -> Box<dyn Future<Item = BlockPutResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
Store input as an IPFS block.
Examples
use ipfs_api::IpfsClient; use std::io::Cursor; let client = IpfsClient::default(); let data = Cursor::new("Hello World!"); let req = client.block_put(data);
pub fn block_rm(
&self,
hash: &str
) -> Box<dyn Future<Item = BlockRmResponse, Error = Error> + Send + 'static>
[src]
&self,
hash: &str
) -> Box<dyn Future<Item = BlockRmResponse, Error = Error> + Send + 'static>
Removes an IPFS block.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.block_rm("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
pub fn block_stat(
&self,
hash: &str
) -> Box<dyn Future<Item = BlockStatResponse, Error = Error> + Send + 'static>
[src]
&self,
hash: &str
) -> Box<dyn Future<Item = BlockStatResponse, Error = Error> + Send + 'static>
Prints information about a raw IPFS block.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.block_stat("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
pub fn bootstrap_add_default(
&self
) -> Box<dyn Future<Item = BootstrapAddDefaultResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = BootstrapAddDefaultResponse, Error = Error> + Send + 'static>
Add default peers to the bootstrap list.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bootstrap_add_default();
pub fn bootstrap_list(
&self
) -> Box<dyn Future<Item = BootstrapListResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = BootstrapListResponse, Error = Error> + Send + 'static>
Lists peers in bootstrap list.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bootstrap_list();
pub fn bootstrap_rm_all(
&self
) -> Box<dyn Future<Item = BootstrapRmAllResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = BootstrapRmAllResponse, Error = Error> + Send + 'static>
Removes all peers in bootstrap list.
Examples
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.bootstrap_rm_all();
pub fn cat(
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
Returns the contents of an Ipfs object.
Examples
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let hash = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA"; let req = client.cat(hash).concat2();
pub fn commands(
&self
) -> Box<dyn Future<Item = CommandsResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = CommandsResponse, Error = Error> + Send + 'static>
List available commands that the server accepts.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.commands();
pub fn config_edit(
&self
) -> Box<dyn Future<Item = ConfigEditResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = ConfigEditResponse, Error = Error> + Send + 'static>
Opens the config file for editing (on the server).
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.config_edit();
pub fn config_replace<R>(
&self,
data: R
) -> Box<dyn Future<Item = ConfigReplaceResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
&self,
data: R
) -> Box<dyn Future<Item = ConfigReplaceResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
Replace the config file.
use ipfs_api::IpfsClient; use std::io::Cursor; let client = IpfsClient::default(); let config = Cursor::new("{..json..}"); let req = client.config_replace(config);
pub fn config_show(
&self
) -> Box<dyn Future<Item = ConfigShowResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = ConfigShowResponse, Error = Error> + Send + 'static>
Show the current config of the server.
Returns an unparsed json string, due to an unclear spec.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.config_show();
pub fn dag_get(
&self,
path: &str
) -> Box<dyn Future<Item = DagGetResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Future<Item = DagGetResponse, Error = Error> + Send + 'static>
Returns information about a dag node in Ipfs.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.dag_get("QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
pub fn dht_findpeer(
&self,
peer: &str
) -> Box<dyn Stream<Item = DhtFindPeerResponse, Error = Error> + Send + 'static>
[src]
&self,
peer: &str
) -> Box<dyn Stream<Item = DhtFindPeerResponse, Error = Error> + Send + 'static>
Query the DHT for all of the multiaddresses associated with a Peer ID.
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let peer = "QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM"; let req = client.dht_findpeer(peer).collect();
pub fn dht_findprovs(
&self,
key: &str
) -> Box<dyn Stream<Item = DhtFindProvsResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Stream<Item = DhtFindProvsResponse, Error = Error> + Send + 'static>
Find peers in the DHT that can provide a specific value given a key.
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let key = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA"; let req = client.dht_findprovs(key).collect();
pub fn dht_get(
&self,
key: &str
) -> Box<dyn Stream<Item = DhtGetResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Stream<Item = DhtGetResponse, Error = Error> + Send + 'static>
Query the DHT for a given key.
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let key = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA"; let req = client.dht_get(key).collect();
pub fn dht_provide(
&self,
key: &str
) -> Box<dyn Stream<Item = DhtProvideResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Stream<Item = DhtProvideResponse, Error = Error> + Send + 'static>
Announce to the network that you are providing a given value.
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let key = "QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA"; let req = client.dht_provide(key).collect();
pub fn dht_put(
&self,
key: &str,
value: &str
) -> Box<dyn Stream<Item = DhtPutResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str,
value: &str
) -> Box<dyn Stream<Item = DhtPutResponse, Error = Error> + Send + 'static>
Write a key/value pair to the DHT.
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.dht_put("test", "Hello World!").collect();
pub fn dht_query(
&self,
peer: &str
) -> Box<dyn Stream<Item = DhtQueryResponse, Error = Error> + Send + 'static>
[src]
&self,
peer: &str
) -> Box<dyn Stream<Item = DhtQueryResponse, Error = Error> + Send + 'static>
Find the closest peer given the peer ID by querying the DHT.
use futures::Stream; use ipfs_api::IpfsClient; let client = IpfsClient::default(); let peer = "QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM"; let req = client.dht_query(peer).collect();
pub fn diag_cmds_clear(
&self
) -> Box<dyn Future<Item = DiagCmdsClearResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = DiagCmdsClearResponse, Error = Error> + Send + 'static>
Clear inactive requests from the log.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.diag_cmds_clear();
pub fn diag_cmds_set_time(
&self,
time: &str
) -> Box<dyn Future<Item = DiagCmdsSetTimeResponse, Error = Error> + Send + 'static>
[src]
&self,
time: &str
) -> Box<dyn Future<Item = DiagCmdsSetTimeResponse, Error = Error> + Send + 'static>
Set how long to keep inactive requests in the log.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.diag_cmds_set_time("1m");
pub fn diag_sys(
&self
) -> Box<dyn Future<Item = DiagSysResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = DiagSysResponse, Error = Error> + Send + 'static>
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::IpfsClient; let client = IpfsClient::default(); let req = client.diag_sys();
pub fn dns(
&self,
link: &str,
recursive: bool
) -> Box<dyn Future<Item = DnsResponse, Error = Error> + Send + 'static>
[src]
&self,
link: &str,
recursive: bool
) -> Box<dyn Future<Item = DnsResponse, Error = Error> + Send + 'static>
Resolve DNS link.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.dns("ipfs.io", true);
pub fn file_ls(
&self,
path: &str
) -> Box<dyn Future<Item = FileLsResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Future<Item = FileLsResponse, Error = Error> + Send + 'static>
List directory for Unix filesystem objects.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.file_ls("/ipns/ipfs.io");
pub fn files_cp(
&self,
path: &str,
dest: &str
) -> Box<dyn Future<Item = FilesCpResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str,
dest: &str
) -> Box<dyn Future<Item = FilesCpResponse, Error = Error> + Send + 'static>
Copy files into MFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_cp("/path/to/file", "/dest");
pub fn files_flush(
&self,
path: Option<&str>
) -> Box<dyn Future<Item = FilesFlushResponse, Error = Error> + Send + 'static>
[src]
&self,
path: Option<&str>
) -> Box<dyn Future<Item = FilesFlushResponse, Error = Error> + Send + 'static>
Flush a path's data to disk.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_flush(None); let req = client.files_flush(Some("/tmp"));
pub fn files_ls(
&self,
path: Option<&str>
) -> Box<dyn Future<Item = FilesLsResponse, Error = Error> + Send + 'static>
[src]
&self,
path: Option<&str>
) -> Box<dyn Future<Item = FilesLsResponse, Error = Error> + Send + 'static>
List directories in MFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_ls(None); let req = client.files_ls(Some("/tmp"));
pub fn files_mkdir(
&self,
path: &str,
parents: bool
) -> Box<dyn Future<Item = FilesMkdirResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str,
parents: bool
) -> Box<dyn Future<Item = FilesMkdirResponse, Error = Error> + Send + 'static>
Make directories in MFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_mkdir("/test", false); let req = client.files_mkdir("/test/nested/dir", true);
pub fn files_mv(
&self,
path: &str,
dest: &str
) -> Box<dyn Future<Item = FilesMvResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str,
dest: &str
) -> Box<dyn Future<Item = FilesMvResponse, Error = Error> + Send + 'static>
Copy files into MFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_mv("/test/tmp.json", "/test/file.json");
pub fn files_read(
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
Read a file in MFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_read("/test/file.json");
pub fn files_rm(
&self,
path: &str,
recursive: bool
) -> Box<dyn Future<Item = FilesRmResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str,
recursive: bool
) -> Box<dyn Future<Item = FilesRmResponse, Error = Error> + Send + 'static>
Remove a file in MFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_rm("/test/dir", true); let req = client.files_rm("/test/file.json", false);
pub fn files_stat(
&self,
path: &str
) -> Box<dyn Future<Item = FilesStatResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Future<Item = FilesStatResponse, Error = Error> + Send + 'static>
Display a file's status in MDFS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.files_stat("/test/file.json");
pub fn files_write<R>(
&self,
path: &str,
create: bool,
truncate: bool,
data: R
) -> Box<dyn Future<Item = FilesWriteResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
&self,
path: &str,
create: bool,
truncate: bool,
data: R
) -> Box<dyn Future<Item = FilesWriteResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
Write to a mutable file in the filesystem.
use ipfs_api::IpfsClient; use std::fs::File; let client = IpfsClient::default(); let file = File::open("test.json").unwrap(); let req = client.files_write("/test/file.json", true, true, file);
pub fn filestore_dups(
&self
) -> Box<dyn Stream<Item = FilestoreDupsResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Stream<Item = FilestoreDupsResponse, Error = Error> + Send + 'static>
List blocks that are both in the filestore and standard block storage.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.filestore_dups();
pub fn filestore_ls(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = FilestoreLsResponse, Error = Error> + Send + 'static>
[src]
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = FilestoreLsResponse, Error = Error> + Send + 'static>
List objects in filestore.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.filestore_ls(Some("QmYPP3BovR2m8UqCZxFbdXSit6SKgExxDkFAPLqiGsap4X"));
pub fn filestore_verify(
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = FilestoreVerifyResponse, Error = Error> + Send + 'static>
[src]
&self,
cid: Option<&str>
) -> Box<dyn Stream<Item = FilestoreVerifyResponse, Error = Error> + Send + 'static>
Verify objects in filestore.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.filestore_verify(None);
pub fn get(
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
Download Ipfs object.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.get("/test/file.json");
pub fn id(
&self,
peer: Option<&str>
) -> Box<dyn Future<Item = IdResponse, Error = Error> + Send + 'static>
[src]
&self,
peer: Option<&str>
) -> Box<dyn Future<Item = IdResponse, Error = Error> + Send + 'static>
Returns information about a peer.
If peer
is None
, returns information about you.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.id(None); let req = client.id(Some("QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM"));
pub fn key_gen(
&self,
name: &str,
kind: KeyType,
size: i32
) -> Box<dyn Future<Item = KeyGenResponse, Error = Error> + Send + 'static>
[src]
&self,
name: &str,
kind: KeyType,
size: i32
) -> Box<dyn Future<Item = KeyGenResponse, Error = Error> + Send + 'static>
Create a new keypair.
use ipfs_api::{IpfsClient, KeyType}; let client = IpfsClient::default(); let req = client.key_gen("test", KeyType::Rsa, 64);
pub fn key_list(
&self
) -> Box<dyn Future<Item = KeyListResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = KeyListResponse, Error = Error> + Send + 'static>
List all local keypairs.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.key_list();
pub fn key_rename(
&self,
name: &str,
new: &str,
force: bool
) -> Box<dyn Future<Item = KeyRenameResponse, Error = Error> + Send + 'static>
[src]
&self,
name: &str,
new: &str,
force: bool
) -> Box<dyn Future<Item = KeyRenameResponse, Error = Error> + Send + 'static>
Rename a keypair.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.key_rename("key_0", "new_name", false);
pub fn key_rm(
&self,
name: &str
) -> Box<dyn Future<Item = KeyRmResponse, Error = Error> + Send + 'static>
[src]
&self,
name: &str
) -> Box<dyn Future<Item = KeyRmResponse, Error = Error> + Send + 'static>
Remove a keypair.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.key_rm("key_0");
pub fn log_level(
&self,
logger: Logger,
level: LoggingLevel
) -> Box<dyn Future<Item = LogLevelResponse, Error = Error> + Send + 'static>
[src]
&self,
logger: Logger,
level: LoggingLevel
) -> Box<dyn Future<Item = LogLevelResponse, Error = Error> + Send + 'static>
Change the logging level for a logger.
use ipfs_api::{IpfsClient, Logger, LoggingLevel}; use std::borrow::Cow; let client = IpfsClient::default(); let req = client.log_level(Logger::All, LoggingLevel::Debug); let req = client.log_level( Logger::Specific(Cow::Borrowed("web")), LoggingLevel::Warning);
pub fn log_ls(
&self
) -> Box<dyn Future<Item = LogLsResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = LogLsResponse, Error = Error> + Send + 'static>
List all logging subsystems.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.log_ls();
pub fn log_tail(
&self
) -> Box<dyn Stream<Item = String, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Stream<Item = String, Error = Error> + Send + 'static>
Read the event log.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.log_tail();
pub fn ls(
&self,
path: Option<&str>
) -> Box<dyn Future<Item = LsResponse, Error = Error> + Send + 'static>
[src]
&self,
path: Option<&str>
) -> Box<dyn Future<Item = LsResponse, Error = Error> + Send + 'static>
List the contents of an Ipfs multihash.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.ls(None); let req = client.ls(Some("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY"));
pub fn name_publish(
&self,
path: &str,
resolve: bool,
lifetime: Option<&str>,
ttl: Option<&str>,
key: Option<&str>
) -> Box<dyn Future<Item = NamePublishResponse, Error = Error> + Send + 'static>
[src]
&self,
path: &str,
resolve: bool,
lifetime: Option<&str>,
ttl: Option<&str>,
key: Option<&str>
) -> Box<dyn Future<Item = NamePublishResponse, Error = Error> + Send + 'static>
Publish an IPFS path to IPNS.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.name_publish( "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY", false, Some("12h"), None, None);
pub fn name_resolve(
&self,
name: Option<&str>,
recursive: bool,
nocache: bool
) -> Box<dyn Future<Item = NameResolveResponse, Error = Error> + Send + 'static>
[src]
&self,
name: Option<&str>,
recursive: bool,
nocache: bool
) -> Box<dyn Future<Item = NameResolveResponse, Error = Error> + Send + 'static>
Resolve an IPNS name.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.name_resolve( Some("/ipns/ipfs.io"), true, false);
pub fn object_data(
&self,
key: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
Output the raw bytes of an Ipfs object.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.object_data("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
pub fn object_diff(
&self,
key0: &str,
key1: &str
) -> Box<dyn Future<Item = ObjectDiffResponse, Error = Error> + Send + 'static>
[src]
&self,
key0: &str,
key1: &str
) -> Box<dyn Future<Item = ObjectDiffResponse, Error = Error> + Send + 'static>
Returns the diff of two Ipfs objects.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.object_diff( "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY", "/ipfs/QmXdNSQx7nbdRvkjGCEQgVjVtVwsHvV8NmV2a8xzQVwuFA");
pub fn object_get(
&self,
key: &str
) -> Box<dyn Future<Item = ObjectGetResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Future<Item = ObjectGetResponse, Error = Error> + Send + 'static>
Returns the data in an object.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.object_get("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
pub fn object_links(
&self,
key: &str
) -> Box<dyn Future<Item = ObjectLinksResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Future<Item = ObjectLinksResponse, Error = Error> + Send + 'static>
Returns the links that an object points to.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.object_links("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
pub fn object_new(
&self,
template: Option<ObjectTemplate>
) -> Box<dyn Future<Item = ObjectNewResponse, Error = Error> + Send + 'static>
[src]
&self,
template: Option<ObjectTemplate>
) -> Box<dyn Future<Item = ObjectNewResponse, Error = Error> + Send + 'static>
Create a new object.
use ipfs_api::{IpfsClient, ObjectTemplate}; let client = IpfsClient::default(); let req = client.object_new(None); let req = client.object_new(Some(ObjectTemplate::UnixFsDir));
pub fn object_stat(
&self,
key: &str
) -> Box<dyn Future<Item = ObjectStatResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str
) -> Box<dyn Future<Item = ObjectStatResponse, Error = Error> + Send + 'static>
Returns the stats for an object.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.object_stat("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
pub fn pin_add(
&self,
key: &str,
recursive: bool
) -> Box<dyn Future<Item = PinAddResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str,
recursive: bool
) -> Box<dyn Future<Item = PinAddResponse, Error = Error> + Send + 'static>
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::IpfsClient; let client = IpfsClient::default(); let req = client.pin_add("QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ", true);
pub fn pin_ls(
&self,
key: Option<&str>,
typ: Option<&str>
) -> Box<dyn Future<Item = PinLsResponse, Error = Error> + Send + 'static>
[src]
&self,
key: Option<&str>,
typ: Option<&str>
) -> Box<dyn Future<Item = PinLsResponse, Error = Error> + Send + 'static>
Returns a list of pinned objects in local storage.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.pin_ls(None, None); let req = client.pin_ls( Some("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY"), None); let req = client.pin_ls(None, Some("direct"));
pub fn pin_rm(
&self,
key: &str,
recursive: bool
) -> Box<dyn Future<Item = PinRmResponse, Error = Error> + Send + 'static>
[src]
&self,
key: &str,
recursive: bool
) -> Box<dyn Future<Item = PinRmResponse, Error = Error> + Send + 'static>
Removes a pinned object from local storage.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.pin_rm( "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY", false); let req = client.pin_rm( "/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY", true);
pub fn ping(
&self,
peer: &str,
count: Option<i32>
) -> Box<dyn Stream<Item = PingResponse, Error = Error> + Send + 'static>
[src]
&self,
peer: &str,
count: Option<i32>
) -> Box<dyn Stream<Item = PingResponse, Error = Error> + Send + 'static>
Pings a peer.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.ping("QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", None); let req = client.ping("QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64", Some(15));
pub fn pubsub_ls(
&self
) -> Box<dyn Future<Item = PubsubLsResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = PubsubLsResponse, Error = Error> + Send + 'static>
List subscribed pubsub topics.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.pubsub_ls();
pub fn pubsub_peers(
&self,
topic: Option<&str>
) -> Box<dyn Future<Item = PubsubPeersResponse, Error = Error> + Send + 'static>
[src]
&self,
topic: Option<&str>
) -> Box<dyn Future<Item = PubsubPeersResponse, Error = Error> + Send + 'static>
List peers that are being published to.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.pubsub_peers(None); let req = client.pubsub_peers(Some("feed"));
pub fn pubsub_pub(
&self,
topic: &str,
payload: &str
) -> Box<dyn Future<Item = PubsubPubResponse, Error = Error> + Send + 'static>
[src]
&self,
topic: &str,
payload: &str
) -> Box<dyn Future<Item = PubsubPubResponse, Error = Error> + Send + 'static>
Publish a message to a topic.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.pubsub_pub("feed", "Hello World!");
pub fn pubsub_sub(
&self,
topic: &str,
discover: bool
) -> Box<dyn Stream<Item = PubsubSubResponse, Error = Error> + Send + 'static>
[src]
&self,
topic: &str,
discover: bool
) -> Box<dyn Stream<Item = PubsubSubResponse, Error = Error> + Send + 'static>
Subscribes to a pubsub topic.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.pubsub_sub("feed", false); let req = client.pubsub_sub("feed", true);
pub fn refs_local(
&self
) -> Box<dyn Stream<Item = RefsLocalResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Stream<Item = RefsLocalResponse, Error = Error> + Send + 'static>
Gets a list of local references.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.refs_local();
pub fn shutdown(
&self
) -> Box<dyn Future<Item = ShutdownResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = ShutdownResponse, Error = Error> + Send + 'static>
Shutdown the Ipfs daemon.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.shutdown();
pub fn stats_bitswap(
&self
) -> Box<dyn Future<Item = StatsBitswapResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = StatsBitswapResponse, Error = Error> + Send + 'static>
Returns bitswap stats.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.stats_bitswap();
pub fn stats_bw(
&self
) -> Box<dyn Future<Item = StatsBwResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = StatsBwResponse, Error = Error> + Send + 'static>
Returns bandwidth stats.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.stats_bw();
pub fn stats_repo(
&self
) -> Box<dyn Future<Item = StatsRepoResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = StatsRepoResponse, Error = Error> + Send + 'static>
Returns repo stats.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.stats_repo();
pub fn swarm_addrs_local(
&self
) -> Box<dyn Future<Item = SwarmAddrsLocalResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = SwarmAddrsLocalResponse, Error = Error> + Send + 'static>
Return a list of local addresses.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.swarm_addrs_local();
pub fn swarm_peers(
&self
) -> Box<dyn Future<Item = SwarmPeersResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = SwarmPeersResponse, Error = Error> + Send + 'static>
Return a list of peers with open connections.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.swarm_peers();
pub fn tar_add<R>(
&self,
data: R
) -> Box<dyn Future<Item = TarAddResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
&self,
data: R
) -> Box<dyn Future<Item = TarAddResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
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::IpfsClient; use std::fs::File; let client = IpfsClient::default(); let tar = File::open("/path/to/file.tar").unwrap(); let req = client.tar_add(tar);
pub fn tar_cat(
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
[src]
&self,
path: &str
) -> Box<dyn Stream<Item = Bytes, Error = Error> + Send + 'static>
Export a tar file from Ipfs.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.tar_cat("/ipfs/QmVrLsEDn27sScp3k23sgZNefVTjSAL3wpgW1iWPi4MgoY");
pub fn version(
&self
) -> Box<dyn Future<Item = VersionResponse, Error = Error> + Send + 'static>
[src]
&self
) -> Box<dyn Future<Item = VersionResponse, Error = Error> + Send + 'static>
Returns information about the Ipfs server version.
use ipfs_api::IpfsClient; let client = IpfsClient::default(); let req = client.version();
Trait Implementations
impl Default for IpfsClient
[src]
fn default() -> IpfsClient
[src]
Creates an IpfsClient
connected to the endpoint specified in ~/.ipfs/api.
If not found, tries to connect to localhost:5001
.
impl Clone for IpfsClient
[src]
fn clone(&self) -> IpfsClient
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<SocketAddr> for IpfsClient
[src]
fn from(socket_addr: SocketAddr) -> Self
[src]
Auto Trait Implementations
impl Send for IpfsClient
impl Sync for IpfsClient
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self