viiper-client 0.6.0

VIIPER Client Library for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
// This file is auto-generated by VIIPER codegen. DO NOT EDIT.

/// Trait for device input types that can be serialized to wire protocol bytes.
///
/// Input types represent data sent from the client to the device (client-to-server).
pub trait DeviceInput {
    /// Serialize this input to wire protocol bytes (little-endian).
    fn to_bytes(&self) -> Vec<u8>;
}

/// Trait for device output types that can be deserialized from wire protocol bytes.
///
/// Output types represent data received from the device (server-to-client).
pub trait DeviceOutput: Sized {
    /// Deserialize this output from wire protocol bytes (little-endian).
    fn from_bytes(buf: &[u8]) -> Result<Self, crate::error::ViiperError>;
}