1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// This is free and unencumbered software released into the public domain.

use crate::{
    prelude::{vec, String, Vec},
    PortDescriptor,
};

/// A block is an autonomous unit of computation in a system.
pub trait BlockDescriptor {
    /// The machine-readable name of this block.
    fn name(&self) -> Option<String> {
        None
    }

    /// A human-readable label for this block.
    fn label(&self) -> Option<String> {
        None
    }

    /// A description of this block's input ports.
    fn inputs(&self) -> Vec<PortDescriptor> {
        vec![]
    }

    /// A description of this block's output ports.
    fn outputs(&self) -> Vec<PortDescriptor> {
        vec![]
    }
}