futuresdr_types/
description.rs

1use serde::{Deserialize, Serialize};
2
3/// Description of a `Flowgraph`.
4///
5/// This struct can be serialized to be used with the REST API.
6#[derive(Debug, Clone, Serialize, Deserialize)]
7pub struct FlowgraphDescription {
8    /// Blocks
9    pub blocks: Vec<BlockDescription>,
10    /// Stream edges
11    pub stream_edges: Vec<(usize, usize, usize, usize)>,
12    /// Message edges
13    pub message_edges: Vec<(usize, usize, usize, usize)>,
14}
15
16/// Description of a `Block`.
17///
18/// This struct can be serialized to be used with the REST API.
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct BlockDescription {
21    /// Id
22    pub id: usize,
23    /// Type name
24    pub type_name: String,
25    /// Instance name
26    pub instance_name: String,
27    /// Stream inputs
28    pub stream_inputs: Vec<String>,
29    /// Stream outputs
30    pub stream_outputs: Vec<String>,
31    /// Message inputs
32    pub message_inputs: Vec<String>,
33    /// Message outputs
34    pub message_outputs: Vec<String>,
35    /// Blocking
36    ///
37    /// Blocking blocks have an async API but are spawned in a separate thread, i.e., it is ok to
38    /// block inside the async function.
39    pub blocking: bool,
40}