rsiot/components_config/uart_general/
fieldbus_response.rs1use std::{fmt::Debug, time::Instant};
2
3use crate::components_config::master_device::RequestResponseBound;
4
5#[derive(Clone, Debug)]
7pub struct FieldbusResponse {
8 pub request_creation_time: Instant,
12
13 pub packet: Vec<u8>,
15}
16
17impl FieldbusResponse {
18 pub fn new(packet: Vec<u8>) -> Self {
20 Self {
21 request_creation_time: Instant::now(),
22 packet,
23 }
24 }
25
26 pub fn to_write_buffer(self) -> Vec<u8> {
28 self.packet
29 }
30}
31
32impl RequestResponseBound for FieldbusResponse {}