Trait serai_coordinator::p2p::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§
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,
Object Safety§
This trait is not object safe.