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

use crate::{
    prelude::{vec, MaybeLabeled, MaybeNamed, Vec},
    ParameterDescriptor, PortDescriptor,
};

/// A block is an autonomous unit of computation in a system.
pub trait BlockDescriptor: MaybeNamed + MaybeLabeled {
    /// 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![]
    }

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