Struct ckb_sync::NetTimeProtocol
source · pub struct NetTimeProtocol { /* private fields */ }Expand description
Collect time offset samples from network peers and send notify to user if offset is too large
Implementations§
Trait Implementations§
source§impl CKBProtocolHandler for NetTimeProtocol
impl CKBProtocolHandler for NetTimeProtocol
source§fn init<'life0, 'async_trait>(
&'life0 mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn init<'life0, 'async_trait>(
&'life0 mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Init action on service run
source§fn connected<'life0, 'life1, 'async_trait>(
&'life0 mut self,
nc: Arc<dyn CKBProtocolContext + Sync>,
peer_index: PeerIndex,
_version: &'life1 str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn connected<'life0, 'life1, 'async_trait>(
&'life0 mut self,
nc: Arc<dyn CKBProtocolContext + Sync>,
peer_index: PeerIndex,
_version: &'life1 str
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Called when opening protocol
source§fn received<'life0, 'async_trait>(
&'life0 mut self,
nc: Arc<dyn CKBProtocolContext + Sync>,
peer_index: PeerIndex,
data: Bytes
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn received<'life0, 'async_trait>(
&'life0 mut self,
nc: Arc<dyn CKBProtocolContext + Sync>,
peer_index: PeerIndex,
data: Bytes
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Called when the corresponding protocol message is received
source§fn disconnected<'life0, 'async_trait>(
&'life0 mut self,
_nc: Arc<dyn CKBProtocolContext + Sync + 'static>,
_peer_index: SessionId
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
fn disconnected<'life0, 'async_trait>(
&'life0 mut self,
_nc: Arc<dyn CKBProtocolContext + Sync + 'static>,
_peer_index: SessionId
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
Self: 'async_trait,
Called when closing protocol