Trait tentacle::traits::SessionProtocol [−][src]
pub trait SessionProtocol {
fn connected(&mut self, _context: ProtocolContextMutRef<'_>, _version: &str) { ... }
fn disconnected(&mut self, _context: ProtocolContextMutRef<'_>) { ... }
fn received(&mut self, _context: ProtocolContextMutRef<'_>, _data: Bytes) { ... }
fn notify(&mut self, _context: ProtocolContextMutRef<'_>, _token: u64) { ... }
fn poll(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
_context: ProtocolContextMutRef<'_>
) -> Poll<Option<()>> { ... }
}
Expand description
Session level protocol handle
Provided methods
fn connected(&mut self, _context: ProtocolContextMutRef<'_>, _version: &str)
fn connected(&mut self, _context: ProtocolContextMutRef<'_>, _version: &str)
Called when opening protocol
fn disconnected(&mut self, _context: ProtocolContextMutRef<'_>)
fn disconnected(&mut self, _context: ProtocolContextMutRef<'_>)
Called when closing protocol
fn received(&mut self, _context: ProtocolContextMutRef<'_>, _data: Bytes)
fn received(&mut self, _context: ProtocolContextMutRef<'_>, _data: Bytes)
Called when the corresponding protocol message is received
fn notify(&mut self, _context: ProtocolContextMutRef<'_>, _token: u64)
fn notify(&mut self, _context: ProtocolContextMutRef<'_>, _token: u64)
Called when the session receives the notify task