Trait serai_coordinator::P2p

source ·
pub trait P2p: Send + Sync + Clone + Debug + TributaryP2p {
    type Id: Send + Sync + Clone + Copy + Debug;

    // Required methods
    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        set: ExternalValidatorSet,
        genesis: [u8; 32],
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn unsubscribe<'life0, 'async_trait>(
        &'life0 self,
        set: ExternalValidatorSet,
        genesis: [u8; 32],
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_raw<'life0, 'async_trait>(
        &'life0 self,
        to: Self::Id,
        msg: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn broadcast_raw<'life0, 'async_trait>(
        &'life0 self,
        kind: P2pMessageKind,
        msg: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn receive<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Message<Self>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn send<'life0, 'async_trait>(
        &'life0 self,
        to: Self::Id,
        kind: ReqResMessageKind,
        msg: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn broadcast<'life0, 'async_trait>(
        &'life0 self,
        kind: impl 'async_trait + Send + Into<P2pMessageKind>,
        msg: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Associated Types§

Required Methods§

source

fn subscribe<'life0, 'async_trait>( &'life0 self, set: ExternalValidatorSet, genesis: [u8; 32], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn unsubscribe<'life0, 'async_trait>( &'life0 self, set: ExternalValidatorSet, genesis: [u8; 32], ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn send_raw<'life0, 'async_trait>( &'life0 self, to: Self::Id, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn broadcast_raw<'life0, 'async_trait>( &'life0 self, kind: P2pMessageKind, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn receive<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Message<Self>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Provided Methods§

source

fn send<'life0, 'async_trait>( &'life0 self, to: Self::Id, kind: ReqResMessageKind, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

source

fn broadcast<'life0, 'async_trait>( &'life0 self, kind: impl 'async_trait + Send + Into<P2pMessageKind>, msg: Vec<u8>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl P2p for LibP2p

§

type Id = PeerId