Skip to main content

spvirit_server/
state.rs

1use std::collections::HashMap;
2
3use spvirit_codec::spvd_decode::StructureDesc;
4
5#[derive(Debug, Default)]
6pub struct ConnState {
7    pub cid_to_sid: HashMap<u32, u32>,
8    pub sid_to_pv: HashMap<u32, String>,
9    pub ioid_to_desc: HashMap<u32, StructureDesc>,
10    pub ioid_to_pv: HashMap<u32, String>,
11    pub ioid_to_monitor: HashMap<u32, MonitorState>,
12}
13
14#[derive(Debug, Clone)]
15pub struct MonitorSub {
16    pub conn_id: u64,
17    pub ioid: u32,
18    pub version: u8,
19    pub is_be: bool,
20    pub running: bool,
21    pub pipeline_enabled: bool,
22    pub nfree: u32,
23    /// When set, only encode these fields in monitor data responses.
24    pub filtered_desc: Option<StructureDesc>,
25}
26
27#[derive(Debug, Clone, Copy)]
28pub struct MonitorState {
29    pub running: bool,
30    pub pipeline_enabled: bool,
31    pub nfree: u32,
32}