[−][src]Trait ckb_network::CKBProtocolHandler
Abstract protocol handle base on tentacle service handle
Required methods
pub fn init(&mut self, nc: Arc<dyn CKBProtocolContext + Sync>)
[src]
Init action on service run
Provided methods
pub fn connected(
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
_peer_index: PeerIndex,
_version: &str
)
[src]
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
_peer_index: PeerIndex,
_version: &str
)
Called when opening protocol
pub fn disconnected(
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
_peer_index: PeerIndex
)
[src]
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
_peer_index: PeerIndex
)
Called when closing protocol
pub fn received(
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
_peer_index: PeerIndex,
_data: Bytes
)
[src]
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
_peer_index: PeerIndex,
_data: Bytes
)
Called when the corresponding protocol message is received
pub fn notify(&mut self, _nc: Arc<dyn CKBProtocolContext + Sync>, _token: u64)
[src]
Called when the Service receives the notify task
pub fn poll(
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>
) -> Poll<Option<()>>
[src]
&mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>
) -> Poll<Option<()>>
Behave like Stream::poll