rsiot/components_config/i2c_master/
fieldbus_request.rs1use std::time::Instant;
2
3use crate::components_config::master_device::RequestResponseBound;
4
5use super::Operation;
6
7#[derive(Clone, Debug)]
10pub struct FieldbusRequest {
11 pub request_creation_time: Instant,
15
16 pub address: u8,
18
19 pub request_kind: u8,
23
24 pub operations: Vec<Operation>,
26}
27impl FieldbusRequest {
30 pub fn new(address: u8, request_kind: impl Into<u8>, operations: Vec<Operation>) -> Self {
32 Self {
33 request_creation_time: Instant::now(),
34 address,
35 request_kind: request_kind.into(),
36 operations,
37 }
38 }
39}
40
41impl RequestResponseBound for FieldbusRequest {}