Struct ipfs_embed::Ipfs[][src]

pub struct Ipfs<P: StoreParams> { /* fields omitted */ }
Expand description

Ipfs node.

Implementations

Creates a new Ipfs from a Config.

This starts three background tasks. The swarm, garbage collector and the dht cleanup tasks run in the background.

Returns the local PublicKey.

Returns the local PeerId.

Returns the local node name.

Listens on a new Multiaddr.

Returns the currently active listener addresses.

Adds an external address.

Returns the currently used external addresses.

Adds a known Multiaddr for a PeerId.

Removes a Multiaddr for a PeerId.

Dials a PeerId using a known address.

Dials a PeerId using Multiaddr.

Bans a PeerId from the swarm, dropping all existing connections and preventing new connections from the peer.

Unbans a previously banned PeerId.

Returns the known peers.

Returns a list of connected peers.

Returns true if there is a connection to peer.

Returns the PeerInfo of a peer.

Bootstraps the dht using a set of bootstrap nodes. After bootstrap completes it provides all blocks in the block store.

Returns true if the dht was bootstrapped.

Gets the closest peer to a key. Useful for finding the Multiaddr of a PeerId.

Gets providers of a key from the dht.

Provides a key in the dht.

Stops providing a key in the dht.

Gets a record from the dht.

Puts a new record in the dht.

Removes a record from the dht.

Subscribes to a topic returning a Stream of messages. If all Streams for a topic are dropped it unsubscribes from the topic.

Publishes a new message in a topic, sending the message to all subscribed peers.

Publishes a new message in a topic, sending the message to all subscribed connected peers.

Creates a temporary pin in the block store. A temporary pin is not persisted to disk and is released once it is dropped.

Adds a new root to a temporary pin.

Returns an Iterator of Cids stored in the block store.

Checks if the block is in the block store.

Returns a block from the block store.

Either returns a block if it’s in the block store or tries to retrieve it from a peer.

Inserts a block in to the block store.

Manually runs garbage collection to completion. This is mainly useful for testing and administrative interfaces. During normal operation, the garbage collector automatically runs in the background.

Creates, updates or removes an alias with a new root Cid.

Returns the root of an alias.

Returns a list of aliases preventing a Cid from being garbage collected.

Flushes the block store. After flush completes successfully it is guaranteed that all writes have been persisted to disk.

Perform a set of storage operations in a batch, and discards the result.

You should keep a batch open for as short as possible. You must not create a batch inside a batch, or use the outer ipfs.

Perform a set of storage operations in a batch, and stores the result.

You should keep a batch open for as short as possible. You must not create a batch inside a batch, or use the outer ipfs.

Registers prometheus metrics in a registry.

Subscribes to the swarm event stream.

Returns the documents both local and replicated.

Returns the streams both local and replicated.

Returns the streams both local and replicated for the given document id.

Adds the peers to a replicated stream.

Returns the current head of a stream.

Returns a reader for the slice.

Removes a local or replicated stream.

Returns a writter to append to a local stream.

Subscribes to a replicated stream.

Updates the head of a replicated stream.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Store parameters.

Temp pin.

Creates a new temporary pin.

Adds a block to a temp pin.

Returns true if the store contains the block.

Returns a block from the store. If the block wasn’t found it returns a BlockNotFound error. Read more

Inserts a block into the store and publishes the block on the network.

Creates an alias for a Cid.

Resolves an alias for a Cid.

Returns all the aliases that are keeping the block around.

Flushes the store.

Returns a block from the store. If the store supports networking and the block is not in the store it fetches it from the network and inserts it into the store. Dropping the future cancels the request. Read more

Fetches all missing blocks recursively from the network. If a block isn’t found it returns a BlockNotFound error. Read more

Resolves a path recursively and returns the ipld.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

The archived version of the pointer metadata for this type.

Converts some archived metadata to the pointer metadata for itself.

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Deserializes using the given deserializer

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

The type for metadata in pointers and references to Self.

Scrape the references from an impl Read. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.