pub trait Codec: Send + Sync {
// Required methods
fn encode<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Bytes, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn decode<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Bytes, HeliaError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn code(&self) -> u64;
}Expand description
IPLD codec trait
Required Methods§
Sourcefn encode<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Bytes, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encode<'life0, 'life1, 'async_trait>(
&'life0 self,
data: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Bytes, HeliaError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Encode data using this codec