Struct ipfs_api::IpfsClient [−][src]
pub struct IpfsClient { /* fields omitted */ }
Asynchronous Ipfs client.
Methods
impl IpfsClient
[src]
impl IpfsClient
pub fn new(host: &str, port: u16) -> Result<IpfsClient, InvalidUri>
[src]
pub fn new(host: &str, port: u16) -> Result<IpfsClient, InvalidUri>
Creates a new IpfsClient
.
impl IpfsClient
[src]
impl IpfsClient
pub fn add<R>(
&self,
data: R
) -> Box<Future<Item = AddResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
pub fn add<R>(
&self,
data: R
) -> Box<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 bitswap_ledger(
&self,
peer: &str
) -> Box<Future<Item = BitswapLedgerResponse, Error = Error> + Send + 'static>
[src]
pub fn bitswap_ledger(
&self,
peer: &str
) -> Box<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<Future<Item = BitswapReprovideResponse, Error = Error> + Send + 'static>
[src]
pub fn bitswap_reprovide(
&self
) -> Box<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<Future<Item = BitswapStatResponse, Error = Error> + Send + 'static>
[src]
pub fn bitswap_stat(
&self
) -> Box<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<Future<Item = BitswapUnwantResponse, Error = Error> + Send + 'static>
[src]
pub fn bitswap_unwant(
&self,
key: &str
) -> Box<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<Future<Item = BitswapWantlistResponse, Error = Error> + Send + 'static>
[src]
pub fn bitswap_wantlist(
&self,
peer: Option<&str>
) -> Box<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<Stream<Item = Chunk, Error = Error> + Send + 'static>
[src]
pub fn block_get(
&self,
hash: &str
) -> Box<Stream<Item = Chunk, 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<Future<Item = BlockPutResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
pub fn block_put<R>(
&self,
data: R
) -> Box<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<Future<Item = BlockRmResponse, Error = Error> + Send + 'static>
[src]
pub fn block_rm(
&self,
hash: &str
) -> Box<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<Future<Item = BlockStatResponse, Error = Error> + Send + 'static>
[src]
pub fn block_stat(
&self,
hash: &str
) -> Box<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<Future<Item = BootstrapAddDefaultResponse, Error = Error> + Send + 'static>
[src]
pub fn bootstrap_add_default(
&self
) -> Box<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<Future<Item = BootstrapListResponse, Error = Error> + Send + 'static>
[src]
pub fn bootstrap_list(
&self
) -> Box<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<Future<Item = BootstrapRmAllResponse, Error = Error> + Send + 'static>
[src]
pub fn bootstrap_rm_all(
&self
) -> Box<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<Stream<Item = Chunk, Error = Error> + Send + 'static>
[src]
pub fn cat(
&self,
path: &str
) -> Box<Stream<Item = Chunk, 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<Future<Item = CommandsResponse, Error = Error> + Send + 'static>
[src]
pub fn commands(
&self
) -> Box<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<Future<Item = ConfigEditResponse, Error = Error> + Send + 'static>
[src]
pub fn config_edit(
&self
) -> Box<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<Future<Item = ConfigReplaceResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
pub fn config_replace<R>(
&self,
data: R
) -> Box<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<Future<Item = ConfigShowResponse, Error = Error> + Send + 'static>
[src]
pub fn config_show(
&self
) -> Box<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<Future<Item = DagGetResponse, Error = Error> + Send + 'static>
[src]
pub fn dag_get(
&self,
path: &str
) -> Box<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<Stream<Item = DhtFindPeerResponse, Error = Error> + Send + 'static>
[src]
pub fn dht_findpeer(
&self,
peer: &str
) -> Box<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<Stream<Item = DhtFindProvsResponse, Error = Error> + Send + 'static>
[src]
pub fn dht_findprovs(
&self,
key: &str
) -> Box<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<Stream<Item = DhtGetResponse, Error = Error> + Send + 'static>
[src]
pub fn dht_get(
&self,
key: &str
) -> Box<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<Stream<Item = DhtProvideResponse, Error = Error> + Send + 'static>
[src]
pub fn dht_provide(
&self,
key: &str
) -> Box<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<Stream<Item = DhtPutResponse, Error = Error> + Send + 'static>
[src]
pub fn dht_put(
&self,
key: &str,
value: &str
) -> Box<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<Stream<Item = DhtQueryResponse, Error = Error> + Send + 'static>
[src]
pub fn dht_query(
&self,
peer: &str
) -> Box<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<Future<Item = DiagCmdsClearResponse, Error = Error> + Send + 'static>
[src]
pub fn diag_cmds_clear(
&self
) -> Box<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<Future<Item = DiagCmdsSetTimeResponse, Error = Error> + Send + 'static>
[src]
pub fn diag_cmds_set_time(
&self,
time: &str
) -> Box<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<Future<Item = DiagSysResponse, Error = Error> + Send + 'static>
[src]
pub fn diag_sys(
&self
) -> Box<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<Future<Item = DnsResponse, Error = Error> + Send + 'static>
[src]
pub fn dns(
&self,
link: &str,
recursive: bool
) -> Box<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<Future<Item = FileLsResponse, Error = Error> + Send + 'static>
[src]
pub fn file_ls(
&self,
path: &str
) -> Box<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<Future<Item = FilesCpResponse, Error = Error> + Send + 'static>
[src]
pub fn files_cp(
&self,
path: &str,
dest: &str
) -> Box<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<Future<Item = FilesFlushResponse, Error = Error> + Send + 'static>
[src]
pub fn files_flush(
&self,
path: Option<&str>
) -> Box<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<Future<Item = FilesLsResponse, Error = Error> + Send + 'static>
[src]
pub fn files_ls(
&self,
path: Option<&str>
) -> Box<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<Future<Item = FilesMkdirResponse, Error = Error> + Send + 'static>
[src]
pub fn files_mkdir(
&self,
path: &str,
parents: bool
) -> Box<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<Future<Item = FilesMvResponse, Error = Error> + Send + 'static>
[src]
pub fn files_mv(
&self,
path: &str,
dest: &str
) -> Box<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<Stream<Item = Chunk, Error = Error> + Send + 'static>
[src]
pub fn files_read(
&self,
path: &str
) -> Box<Stream<Item = Chunk, 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<Future<Item = FilesRmResponse, Error = Error> + Send + 'static>
[src]
pub fn files_rm(
&self,
path: &str,
recursive: bool
) -> Box<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<Future<Item = FilesStatResponse, Error = Error> + Send + 'static>
[src]
pub fn files_stat(
&self,
path: &str
) -> Box<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<Future<Item = FilesWriteResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
pub fn files_write<R>(
&self,
path: &str,
create: bool,
truncate: bool,
data: R
) -> Box<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<Stream<Item = FilestoreDupsResponse, Error = Error> + Send + 'static>
[src]
pub fn filestore_dups(
&self
) -> Box<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<Stream<Item = FilestoreLsResponse, Error = Error> + Send + 'static>
[src]
pub fn filestore_ls(
&self,
cid: Option<&str>
) -> Box<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<Stream<Item = FilestoreVerifyResponse, Error = Error> + Send + 'static>
[src]
pub fn filestore_verify(
&self,
cid: Option<&str>
) -> Box<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<Stream<Item = Chunk, Error = Error> + Send + 'static>
[src]
pub fn get(
&self,
path: &str
) -> Box<Stream<Item = Chunk, 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<Future<Item = IdResponse, Error = Error> + Send + 'static>
[src]
pub fn id(
&self,
peer: Option<&str>
) -> Box<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<Future<Item = KeyGenResponse, Error = Error> + Send + 'static>
[src]
pub fn key_gen(
&self,
name: &str,
kind: KeyType,
size: i32
) -> Box<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<Future<Item = KeyListResponse, Error = Error> + Send + 'static>
[src]
pub fn key_list(
&self
) -> Box<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<Future<Item = KeyRenameResponse, Error = Error> + Send + 'static>
[src]
pub fn key_rename(
&self,
name: &str,
new: &str,
force: bool
) -> Box<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<Future<Item = KeyRmResponse, Error = Error> + Send + 'static>
[src]
pub fn key_rm(
&self,
name: &str
) -> Box<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<Future<Item = LogLevelResponse, Error = Error> + Send + 'static>
[src]
pub fn log_level(
&self,
logger: Logger,
level: LoggingLevel
) -> Box<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<Future<Item = LogLsResponse, Error = Error> + Send + 'static>
[src]
pub fn log_ls(
&self
) -> Box<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<Stream<Item = String, Error = Error> + Send + 'static>
[src]
pub fn log_tail(
&self
) -> Box<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<Future<Item = LsResponse, Error = Error> + Send + 'static>
[src]
pub fn ls(
&self,
path: Option<&str>
) -> Box<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<Future<Item = NamePublishResponse, Error = Error> + Send + 'static>
[src]
pub fn name_publish(
&self,
path: &str,
resolve: bool,
lifetime: Option<&str>,
ttl: Option<&str>,
key: Option<&str>
) -> Box<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<Future<Item = NameResolveResponse, Error = Error> + Send + 'static>
[src]
pub fn name_resolve(
&self,
name: Option<&str>,
recursive: bool,
nocache: bool
) -> Box<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<Stream<Item = Chunk, Error = Error> + Send + 'static>
[src]
pub fn object_data(
&self,
key: &str
) -> Box<Stream<Item = Chunk, 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<Future<Item = ObjectDiffResponse, Error = Error> + Send + 'static>
[src]
pub fn object_diff(
&self,
key0: &str,
key1: &str
) -> Box<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<Future<Item = ObjectGetResponse, Error = Error> + Send + 'static>
[src]
pub fn object_get(
&self,
key: &str
) -> Box<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<Future<Item = ObjectLinksResponse, Error = Error> + Send + 'static>
[src]
pub fn object_links(
&self,
key: &str
) -> Box<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<Future<Item = ObjectNewResponse, Error = Error> + Send + 'static>
[src]
pub fn object_new(
&self,
template: Option<ObjectTemplate>
) -> Box<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<Future<Item = ObjectStatResponse, Error = Error> + Send + 'static>
[src]
pub fn object_stat(
&self,
key: &str
) -> Box<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<Future<Item = PinAddResponse, Error = Error> + Send + 'static>
[src]
pub fn pin_add(
&self,
key: &str,
recursive: bool
) -> Box<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<Future<Item = PinLsResponse, Error = Error> + Send + 'static>
[src]
pub fn pin_ls(
&self,
key: Option<&str>,
typ: Option<&str>
) -> Box<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<Future<Item = PinRmResponse, Error = Error> + Send + 'static>
[src]
pub fn pin_rm(
&self,
key: &str,
recursive: bool
) -> Box<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<Stream<Item = PingResponse, Error = Error> + Send + 'static>
[src]
pub fn ping(
&self,
peer: &str,
count: Option<i32>
) -> Box<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<Future<Item = PubsubLsResponse, Error = Error> + Send + 'static>
[src]
pub fn pubsub_ls(
&self
) -> Box<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<Future<Item = PubsubPeersResponse, Error = Error> + Send + 'static>
[src]
pub fn pubsub_peers(
&self,
topic: Option<&str>
) -> Box<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<Future<Item = PubsubPubResponse, Error = Error> + Send + 'static>
[src]
pub fn pubsub_pub(
&self,
topic: &str,
payload: &str
) -> Box<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<Stream<Item = PubsubSubResponse, Error = Error> + Send + 'static>
[src]
pub fn pubsub_sub(
&self,
topic: &str,
discover: bool
) -> Box<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<Stream<Item = RefsLocalResponse, Error = Error> + Send + 'static>
[src]
pub fn refs_local(
&self
) -> Box<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<Future<Item = ShutdownResponse, Error = Error> + Send + 'static>
[src]
pub fn shutdown(
&self
) -> Box<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<Future<Item = StatsBitswapResponse, Error = Error> + Send + 'static>
[src]
pub fn stats_bitswap(
&self
) -> Box<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<Future<Item = StatsBwResponse, Error = Error> + Send + 'static>
[src]
pub fn stats_bw(
&self
) -> Box<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<Future<Item = StatsRepoResponse, Error = Error> + Send + 'static>
[src]
pub fn stats_repo(
&self
) -> Box<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<Future<Item = SwarmAddrsLocalResponse, Error = Error> + Send + 'static>
[src]
pub fn swarm_addrs_local(
&self
) -> Box<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<Future<Item = SwarmPeersResponse, Error = Error> + Send + 'static>
[src]
pub fn swarm_peers(
&self
) -> Box<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<Future<Item = TarAddResponse, Error = Error> + Send + 'static> where
R: 'static + Read + Send,
[src]
pub fn tar_add<R>(
&self,
data: R
) -> Box<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<Stream<Item = Chunk, Error = Error> + Send + 'static>
[src]
pub fn tar_cat(
&self,
path: &str
) -> Box<Stream<Item = Chunk, 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<Future<Item = VersionResponse, Error = Error> + Send + 'static>
[src]
pub fn version(
&self
) -> Box<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 Clone for IpfsClient
[src]
impl Clone for IpfsClient
fn clone(&self) -> IpfsClient
[src]
fn clone(&self) -> IpfsClient
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Default for IpfsClient
[src]
impl Default for IpfsClient
fn default() -> IpfsClient
[src]
fn default() -> IpfsClient
Creates an IpfsClient
connected to localhost:5001
.
Auto Trait Implementations
impl Send for IpfsClient
impl Send for IpfsClient
impl Sync for IpfsClient
impl Sync for IpfsClient