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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.