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§

source

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.

Implementations on Foreign Types§

source§

impl AsyncEncodable for &str

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for bool

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWriteExt + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for f32

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWriteExt + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for f64

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWriteExt + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for i8

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for i16

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for i32

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for i64

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for i128

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for u8

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for u16

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for u32

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for u64

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for u128

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for usize

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for String

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for BuildMetadata

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Prerelease

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Version

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Url

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Address

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Ep

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Eq

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Fp

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Fq

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Hash

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl AsyncEncodable for Position

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<C: AsyncEncodable + Sync> AsyncEncodable for Checkpoint<C>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<H: AsyncEncodable + Sync + Send + Ord + Clone> AsyncEncodable for MerkleBridge<H>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<H: AsyncEncodable + Sync + Send + Ord + Clone> AsyncEncodable for NonEmptyFrontier<H>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<H: AsyncEncodable + Sync + Send + Ord + Clone, C: AsyncEncodable + Sync + Debug, const DEPTH: u8> AsyncEncodable for BridgeTree<H, C, DEPTH>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync> AsyncEncodable for (T0, T1)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync, T2: AsyncEncodable + Sync> AsyncEncodable for (T0, T1, T2)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync, T2: AsyncEncodable + Sync, T3: AsyncEncodable + Sync> AsyncEncodable for (T0, T1, T2, T3)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync, T2: AsyncEncodable + Sync, T3: AsyncEncodable + Sync, T4: AsyncEncodable + Sync> AsyncEncodable for (T0, T1, T2, T3, T4)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync, T2: AsyncEncodable + Sync, T3: AsyncEncodable + Sync, T4: AsyncEncodable + Sync, T5: AsyncEncodable + Sync> AsyncEncodable for (T0, T1, T2, T3, T4, T5)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync, T2: AsyncEncodable + Sync, T3: AsyncEncodable + Sync, T4: AsyncEncodable + Sync, T5: AsyncEncodable + Sync, T6: AsyncEncodable + Sync> AsyncEncodable for (T0, T1, T2, T3, T4, T5, T6)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T0: AsyncEncodable + Sync, T1: AsyncEncodable + Sync, T2: AsyncEncodable + Sync, T3: AsyncEncodable + Sync, T4: AsyncEncodable + Sync, T5: AsyncEncodable + Sync, T6: AsyncEncodable + Sync, T7: AsyncEncodable + Sync> AsyncEncodable for (T0, T1, T2, T3, T4, T5, T6, T7)

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T, const N: usize> AsyncEncodable for [T; N]
where T: AsyncEncodable + Sync,

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync> AsyncEncodable for Option<T>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync> AsyncEncodable for BTreeSet<T>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync> AsyncEncodable for VecDeque<T>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync> AsyncEncodable for Vec<T>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync> AsyncEncodable for HashSet<T>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync, U: AsyncEncodable + Sync> AsyncEncodable for BTreeMap<T, U>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

source§

impl<T: AsyncEncodable + Sync, U: AsyncEncodable + Sync> AsyncEncodable for HashMap<T, U>

source§

fn encode_async<'life0, 'life1, 'async_trait, S>( &'life0 self, s: &'life1 mut S ) -> Pin<Box<dyn Future<Output = Result<usize>> + Send + 'async_trait>>
where S: 'async_trait + AsyncWrite + Unpin + Send, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Implementors§