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

Called when opening protocol

Called when closing protocol

Called when the corresponding protocol message is received

Called when the session receives the notify task

Behave like Stream::poll_next, but nothing output if ready with Some, it will continue poll immediately if ready with None, it will don’t try to call the function again

Implementations on Foreign Types

Implementors