Skip to main content

DeviceSession

Trait DeviceSession 

Source
pub trait DeviceSession: Send + 'static {
    // Required methods
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        stream: &'life1 mut TcpStream,
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn receive(&mut self, frame: &[u8]) -> Result<(Vec<u8>, Option<Value>)>;
    fn answer(
        &mut self,
        request: &Value,
        action: Option<&Value>,
    ) -> Result<Vec<u8>>;
}

Required Methods§

Source

fn read<'life0, 'life1, 'async_trait>( &'life0 mut self, stream: &'life1 mut TcpStream, ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source

fn receive(&mut self, frame: &[u8]) -> Result<(Vec<u8>, Option<Value>)>

Automatic transport replies or a semantic request for the handler.

Source

fn answer(&mut self, request: &Value, action: Option<&Value>) -> Result<Vec<u8>>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl DeviceSession for netget::server::s7comm::codec::Device

Source§

impl DeviceSession for netget::server::ethernet_ip::codec::Device

Source§

impl DeviceSession for netget::server::dnp3::codec::Device

Source§

impl DeviceSession for netget::server::iec104::codec::Device