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
.
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 Multiaddr
.
Bans a PeerId
from the swarm, dropping all existing connections and
preventing new connections from the peer.
Returns true
if there is a connection to 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.
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 Stream
s 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 Cid
s stored in the block store.
Either returns a block if it’s in the block store or tries to retrieve it from a peer.
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 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
type Params = P
type Params = P
Store parameters.
Creates a new temporary pin.
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
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 DagPath<'life2>
) -> Pin<Box<dyn Future<Output = Result<Ipld, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
fn query<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
path: &'life1 DagPath<'life2>
) -> Pin<Box<dyn Future<Output = Result<Ipld, Error>> + Send + 'async_trait, Global>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Ipld: Decode<<Self::Params as StoreParams>::Codecs>,
Resolves a path recursively and returns the ipld.
Auto Trait Implementations
impl<P> !RefUnwindSafe for Ipfs<P>
impl<P> !UnwindSafe for Ipfs<P>
Blanket Implementations
type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
pub fn pointer_metadata(
&<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
Mutably borrows from an owned value. Read more
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
pub fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V