photon_api/models/
state_queue_data_v2.rs

1/*
2 * photon-indexer
3 *
4 * Solana indexer for general compression
5 *
6 * The version of the OpenAPI document: 0.0.0
7 *
8 * Generated by: https://openapi-generator.tech
9 */
10
11use crate::models;
12
13/// State queue data with shared tree nodes for output and input queues
14#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
15#[allow(clippy::too_many_arguments)]
16pub struct StateQueueDataV2 {
17    /// Shared deduplicated tree nodes for state queues (output + input)
18    /// node_index encoding: (level << 56) | position
19    #[serde(rename = "nodes", skip_serializing_if = "Vec::is_empty", default)]
20    pub nodes: Vec<u64>,
21    #[serde(rename = "nodeHashes", skip_serializing_if = "Vec::is_empty", default)]
22    pub node_hashes: Vec<String>,
23    /// Initial root for the state tree (shared by output and input queues)
24    #[serde(rename = "initialRoot")]
25    pub initial_root: String,
26    /// Sequence number of the root
27    #[serde(rename = "rootSeq")]
28    pub root_seq: u64,
29    #[serde(rename = "outputQueue", skip_serializing_if = "Option::is_none")]
30    pub output_queue: Option<Box<models::OutputQueueDataV2>>,
31    #[serde(rename = "inputQueue", skip_serializing_if = "Option::is_none")]
32    pub input_queue: Option<Box<models::InputQueueDataV2>>,
33}
34
35impl StateQueueDataV2 {
36    pub fn new(initial_root: String, root_seq: u64) -> StateQueueDataV2 {
37        StateQueueDataV2 {
38            nodes: Vec::new(),
39            node_hashes: Vec::new(),
40            initial_root,
41            root_seq,
42            output_queue: None,
43            input_queue: None,
44        }
45    }
46}