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.50.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#[serde(rename_all = "camelCase")]
16#[allow(clippy::too_many_arguments)]
17pub struct StateQueueDataV2 {
18    /// Shared deduplicated tree nodes for state queues (output + input)
19    #[serde(skip_serializing_if = "Vec::is_empty", default)]
20    pub nodes: Vec<models::Node>,
21    /// Initial root for the state tree (shared by output and input queues)
22    pub initial_root: String,
23    /// Sequence number of the root
24    pub root_seq: u64,
25    #[serde(skip_serializing_if = "Option::is_none")]
26    pub output_queue: Option<Box<models::OutputQueueDataV2>>,
27    #[serde(skip_serializing_if = "Option::is_none")]
28    pub input_queue: Option<Box<models::InputQueueDataV2>>,
29}
30
31impl StateQueueDataV2 {
32    pub fn new(initial_root: String, root_seq: u64) -> StateQueueDataV2 {
33        StateQueueDataV2 {
34            nodes: Vec::new(),
35            initial_root,
36            root_seq,
37            output_queue: None,
38            input_queue: None,
39        }
40    }
41}