Helia

Trait Helia 

Source
pub trait Helia: Send + Sync {
    // Required methods
    fn blockstore(&self) -> &dyn Blocks;
    fn datastore(&self) -> &dyn Datastore;
    fn pins(&self) -> &dyn Pins;
    fn logger(&self) -> &dyn ComponentLogger;
    fn routing(&self) -> &dyn Routing;
    fn dns(&self) -> &TokioAsyncResolver;
    fn metrics(&self) -> Option<&dyn Metrics>;
    fn start<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn stop<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn gc<'life0, 'async_trait>(
        &'life0 self,
        options: Option<GcOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_codec<'life0, 'async_trait>(
        &'life0 self,
        code: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Codec>, HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_hasher<'life0, 'async_trait>(
        &'life0 self,
        code: u64,
    ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Hasher>, HeliaError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Non-generic Helia trait for backward compatibility and trait objects

Required Methods§

Source

fn blockstore(&self) -> &dyn Blocks

The blockstore for storing blocks

Source

fn datastore(&self) -> &dyn Datastore

The datastore for key-value storage

Source

fn pins(&self) -> &dyn Pins

Pinning operations

Source

fn logger(&self) -> &dyn ComponentLogger

The logger component

Source

fn routing(&self) -> &dyn Routing

The routing component

Source

fn dns(&self) -> &TokioAsyncResolver

DNS resolver

Source

fn metrics(&self) -> Option<&dyn Metrics>

Optional metrics collector

Source

fn start<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Start the Helia node

Source

fn stop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop the Helia node

Source

fn gc<'life0, 'async_trait>( &'life0 self, options: Option<GcOptions>, ) -> Pin<Box<dyn Future<Output = Result<(), HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Perform garbage collection

Source

fn get_codec<'life0, 'async_trait>( &'life0 self, code: u64, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Codec>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load an IPLD codec

Source

fn get_hasher<'life0, 'async_trait>( &'life0 self, code: u64, ) -> Pin<Box<dyn Future<Output = Result<Box<dyn Hasher>, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load a hasher

Implementors§