pub struct LightClientProtocol {
pub shared: Arc<SyncShared>,
}Expand description
Light client protocol handler.
Fields§
Sync shared state.
Implementations§
source§impl LightClientProtocol
impl LightClientProtocol
sourcepub fn new(shared: Arc<SyncShared>) -> Self
pub fn new(shared: Arc<SyncShared>) -> Self
Create a new light client protocol handler.
Trait Implementations§
source§impl CKBProtocolHandler for LightClientProtocol
impl CKBProtocolHandler for LightClientProtocol
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: 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: 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 disconnected<'life0, 'async_trait>(
&'life0 mut self,
_nc: Arc<dyn CKBProtocolContext + Sync>,
peer: PeerIndex
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disconnected<'life0, 'async_trait>( &'life0 mut self, _nc: Arc<dyn CKBProtocolContext + Sync>, peer: PeerIndex ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,
Called when closing protocol
source§fn received<'life0, 'async_trait>(
&'life0 mut self,
nc: Arc<dyn CKBProtocolContext + Sync>,
peer: 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: 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
Auto Trait Implementations§
impl !RefUnwindSafe for LightClientProtocol
impl Send for LightClientProtocol
impl Sync for LightClientProtocol
impl Unpin for LightClientProtocol
impl !UnwindSafe for LightClientProtocol
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more