Skip to main content

RiProtocol

Trait RiProtocol 

Source
pub trait RiProtocol {
    // Required methods
    fn protocol_type(&self) -> RiProtocolType;
    fn is_ready<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn initialize<'life0, 'async_trait>(
        &'life0 mut self,
        config: RiProtocolConfig,
    ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send_message<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        target: &'life1 str,
        data: &'life2 [u8],
    ) -> Pin<Box<dyn Future<Output = RiResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn send_message_with_flags<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        target: &'life1 str,
        data: &'life2 [u8],
        flags: RiMessageFlags,
    ) -> Pin<Box<dyn Future<Output = RiResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
    fn receive_message<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = RiResult<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_connection_info<'life0, 'life1, 'async_trait>(
        &'life0 self,
        connection_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = RiResult<RiConnectionInfo>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn close_connection<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        connection_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn get_stats(&self) -> RiProtocolStats;
    fn get_health<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RiProtocolHealth> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn shutdown<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Core protocol trait

Required Methods§

Source

fn protocol_type(&self) -> RiProtocolType

Get protocol type

Source

fn is_ready<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Check if protocol is ready

Source

fn initialize<'life0, 'async_trait>( &'life0 mut self, config: RiProtocolConfig, ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Initialize protocol

Source

fn send_message<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, target: &'life1 str, data: &'life2 [u8], ) -> Pin<Box<dyn Future<Output = RiResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Send message

Source

fn send_message_with_flags<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, target: &'life1 str, data: &'life2 [u8], flags: RiMessageFlags, ) -> Pin<Box<dyn Future<Output = RiResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Send message with flags

Source

fn receive_message<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = RiResult<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Receive message

Source

fn get_connection_info<'life0, 'life1, 'async_trait>( &'life0 self, connection_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RiResult<RiConnectionInfo>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get connection info

Source

fn close_connection<'life0, 'life1, 'async_trait>( &'life0 mut self, connection_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Close connection

Source

fn get_stats(&self) -> RiProtocolStats

Get protocol statistics

Source

fn get_health<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RiProtocolHealth> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get protocol health

Source

fn shutdown<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = RiResult<()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Shutdown protocol

Implementors§