Struct ipfsapi::IpfsApi [] [src]

pub struct IpfsApi { /* fields omitted */ }

Methods

impl IpfsApi
[src]

[src]

Retrieves the contents of a file from the IPFS network. Takes a hash and returns an iterator of bytes. The result can be streamed, if the file is large.

This example is not tested
let api = IpfsApi::new("127.0.0.1", 5001);

let hello = api.cat("QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u")?;
let hello_string = String::from_utf8(hello.collect())?;
println!("{}", hello_string);

impl IpfsApi
[src]

[src]

Resolve an IPNS hash or a domain name

This example is not tested
let api = IpfsApi::new("127.0.0.1", 5001);
let hash = api.name_resolve("gkbrk.com");

println!("{}", hash);

[src]

Publish an IPFS hash in IPNS.

impl IpfsApi
[src]

[src]

Get stats for an IPFS hash. It can be used to get the recursive size of a hash.

impl IpfsApi
[src]

[src]

Tells the IPFS server to pin the given object. If 'recursive' is true, it will recursively pin all objects that one depends on. If 'progress' is true, it will return a percentage(?) progress if the object has not been already pinned, or None if it has.

[src]

Unpin the given object.

[src]

List pinned objects.

impl IpfsApi
[src]

[src]

Subscribes to a channel for p2p messages This function subscribes to a channel/topic and listens to any data sent to it. It can be used for peer-to-peer communication and dynamic apps over IPFS.

This example is not tested
let api = IpfsApi::new("127.0.0.1", 5001);

for message in api.pubsub_subscribe("chat")? {
    println!("{:?}", message);
}

[src]

Sends a p2p message to a channel This function sends a data packet to a channel/topic. It can be used for peer-to-peer communication and dynamic apps over IPFS.

impl IpfsApi
[src]

[src]

Get the version from the IPFS daemon.

impl IpfsApi
[src]

[src]

Shut down the IPFS daemon This function causes the IPFS daemon to terminate

impl IpfsApi
[src]

[src]

Returns an iterator to the log stream. Since the log entries are flexible, a dynamic Serde value is returned.

impl IpfsApi
[src]

The main interface of the library The IpfsApi class represents a connection to the local IPFS daemon. It can read and write data to it using http requests to the server.

[src]

Creates a new instance of the API

This example is not tested
let api = IpfsApi::new("127.0.0.1", 5001);

Trait Implementations

Auto Trait Implementations

impl Send for IpfsApi

impl Sync for IpfsApi