Crate rust_helia

Crate rust_helia 

Source
Expand description

§Helia

An implementation of IPFS in Rust

This crate provides a create_helia function that returns an object implementing the Helia trait. Pass it to other modules like helia-unixfs to make files available on the distributed web.

§Example

use rust_helia::create_helia;
use cid::Cid;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let helia = create_helia(None).await?;
     
    // Use helia with other modules
    // let fs = helia_unixfs::create_unixfs(helia);
    // fs.cat(&cid).await?;
     
    Ok(())
}

Modules§

blocks
Block storage and retrieval interfaces
errors
Error types for Helia operations
pins
Pinning interface for content addressing
routing
Routing interface for peer and content discovery

Structs§

AbortOptions
Options that include an abort signal for canceling operations
AddOptions
Options for adding pins
BlockstoreConfig
Configuration for the blockstore
DatastoreConfig
Configuration for the datastore
DeleteManyOptions
Options for deleting blocks
FindPeersOptions
Options for finding peers
FindProvidersOptions
Options for finding providers
GcOptions
Garbage collection options
GetAllOptions
Options for getting all blocks
GetBlockOptions
Options for getting a block
GetManyOptions
Options for getting multiple blocks
GetOptions
Options for getting peer info
HasOptions
Options for checking if blocks exist
InputPair
Input pair that may not have been stored yet
IsPinnedOptions
Options for checking if content is pinned
LoggerConfig
Configuration for the logger
LsOptions
Options for listing pins
Pair
A key-value pair for block operations
PeerInfo
Information about a peer
ProgressEvent
Progress event for tracking operation status
ProgressOptions
Options for operations that support progress tracking
ProvideOptions
Options for providing content
Provider
A provider can supply content for a CID
ProviderOptions
Options for specifying content providers
PutBlockOptions
Options for putting a block
PutManyOptions
Options for putting multiple blocks
PutOptions
Options for putting records
RmOptions
Options for removing pins
RoutingOptions
Options for routing operations
RoutingRecord
A routing record

Enums§

AddPinEvents
Progress events for adding pins
AddPinProgressEvents
Combined progress events for adding pins
DeleteManyBlocksProgressEvents
Progress events for deleting blocks
GcEvent
Events emitted during garbage collection
GetAllBlocksProgressEvents
Progress events for getting all blocks
GetBlockProgressEvents
Progress events for getting a block
GetManyBlocksProgressEvents
Progress events for getting multiple blocks
HasBlockProgressEvents
Progress events for checking if a block exists
HeliaError
Main error type for Helia operations
HeliaEvent
Events emitted by a Helia node
PinMetadataValue
Valid metadata values for pins
PinType
Types of pins
ProviderInfo
Information about a content provider
PutBlockProgressEvents
Progress events for putting a single block
PutManyBlocksProgressEvents
Progress events for putting multiple blocks
TransportMethod
Methods available for content transport

Traits§

Blocks
Block storage interface
Codec
IPLD codec trait
CodecLoader
Codec loader for loading IPLD codecs
ComponentLogger
Component logger for structured logging
Datastore
Key-value datastore interface
Hasher
Multihash hasher trait
HasherLoader
Hasher loader for loading multihash hashers
Helia
Non-generic Helia trait for backward compatibility and trait objects
HeliaWithLibp2p
Generic Helia trait with libp2p type parameter for concrete implementations
Metrics
Metrics collection interface
Pins
Pinning interface
Routing
Routing interface for peer and content discovery

Functions§

create_helia
Create a new Helia node with the given configuration
create_helia_default
Create a new Helia node with default configuration
create_swarm
Create a libp2p Swarm with Helia’s default configuration
create_swarm_with_keypair
Create a libp2p Swarm with custom keypair

Type Aliases§

Await
Type alias for awaitable results
AwaitIterable
Type alias for async iterables/streams
HeliaEventReceiver
Type alias for event receiver