Trait WebSocketRequestHandler

Source
pub trait WebSocketRequestHandler:
    Send
    + Sync
    + 'static {
    // Required methods
    fn on_session_begin<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session: &'life1 Arc<WebSocketSession>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn on_session_end<'life0, 'life1, 'async_trait>(
        &'life0 self,
        session: &'life1 Arc<WebSocketSession>,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn clone_handler(&self) -> Box<dyn WebSocketRequestHandler>;

    // Provided methods
    fn on_request<'life0, 'async_trait>(
        &'life0 self,
        requestor: Arc<WebSocketRequestManager>,
        cmd: u16,
        content: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = BuckyResult<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn process_string_request<'life0, 'async_trait>(
        &'life0 self,
        requestor: Arc<WebSocketRequestManager>,
        cmd: u16,
        content: Vec<u8>,
    ) -> Pin<Box<dyn Future<Output = BuckyResult<Option<Vec<u8>>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn on_string_request<'life0, 'async_trait>(
        &'life0 self,
        _requestor: Arc<WebSocketRequestManager>,
        _cmd: u16,
        _content: String,
    ) -> Pin<Box<dyn Future<Output = BuckyResult<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}

Required Methods§

Source

fn on_session_begin<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Arc<WebSocketSession>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn on_session_end<'life0, 'life1, 'async_trait>( &'life0 self, session: &'life1 Arc<WebSocketSession>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn clone_handler(&self) -> Box<dyn WebSocketRequestHandler>

Provided Methods§

Source

fn on_request<'life0, 'async_trait>( &'life0 self, requestor: Arc<WebSocketRequestManager>, cmd: u16, content: Vec<u8>, ) -> Pin<Box<dyn Future<Output = BuckyResult<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn process_string_request<'life0, 'async_trait>( &'life0 self, requestor: Arc<WebSocketRequestManager>, cmd: u16, content: Vec<u8>, ) -> Pin<Box<dyn Future<Output = BuckyResult<Option<Vec<u8>>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source

fn on_string_request<'life0, 'async_trait>( &'life0 self, _requestor: Arc<WebSocketRequestManager>, _cmd: u16, _content: String, ) -> Pin<Box<dyn Future<Output = BuckyResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§