Trait darkfi_serial::AsyncEncodable
source · pub trait AsyncEncodable {
// Required method
fn encode_async<'life0, 'life1, 'async_trait, W>(
&'life0 self,
w: &'life1 mut W,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where W: 'async_trait + AsyncWrite + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Data which can asynchronously be encoded in a consensus-consistent way.
Required Methods§
sourcefn encode_async<'life0, 'life1, 'async_trait, W>(
&'life0 self,
w: &'life1 mut W,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
W: 'async_trait + AsyncWrite + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn encode_async<'life0, 'life1, 'async_trait, W>(
&'life0 self,
w: &'life1 mut W,
) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>where
W: 'async_trait + AsyncWrite + Unpin + Send,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Asynchronously encode an object with a well-defined format.
Should only ever error if the underlying AsyncWrite
errors.
Returns the number of bytes written on success.
Object Safety§
This trait is not object safe.