Skip to main content

StringsInterface

Trait StringsInterface 

Source
pub trait StringsInterface: Send + Sync {
    // Required methods
    fn add<'life0, 'life1, 'async_trait>(
        &'life0 self,
        string: &'life1 str,
        options: Option<AddOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<Cid, StringsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get<'life0, 'async_trait>(
        &'life0 self,
        cid: Cid,
        options: Option<GetOptions>,
    ) -> Pin<Box<dyn Future<Output = Result<String, StringsError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

The Strings interface provides a simple and intuitive way to add/get strings with your Helia node and is a great place to start learning about IPFS.

Required Methods§

Source

fn add<'life0, 'life1, 'async_trait>( &'life0 self, string: &'life1 str, options: Option<AddOptions>, ) -> Pin<Box<dyn Future<Output = Result<Cid, StringsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Add a string to your Helia node and get a CID that refers to the block the string has been stored as.

Source

fn get<'life0, 'async_trait>( &'life0 self, cid: Cid, options: Option<GetOptions>, ) -> Pin<Box<dyn Future<Output = Result<String, StringsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get a string from your Helia node, either previously added to it or to another node on the network.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§