[][src]Module gazpatcho::config

Configuration defining available node types, pins and widgets that will be available in given application instance.

Example

The following example illustrates a Config which leverages all the available constructs.

For more info about each sub-structure, see their respective documentation.

let config = Config {
    node_templates: vec![
        NodeTemplate {
            label: "Oscillator".to_owned(),
            class: "oscillator".to_owned(),
            display_heading: true,
            pins: vec![
                Pin {
                    label: "Frequency".to_owned(),
                    class: "frequency".to_owned(),
                    direction: Input,
                },
                Pin {
                    label: "Output".to_owned(),
                    class: "output".to_owned(),
                    direction: Output,
                },
            ],
            widgets: vec![
                TextBox {
                    key: "comment".to_owned(),
                    capacity: 1000,
                    size: [300.0, 100.0],
                    read_only: false,
                },
                Slider {
                    key: "slider".to_owned(),
                    min: 0.0,
                    max: 10.0,
                    default: 5.0,
                    format: "%.1f".to_owned(),
                    width: 150.0,
                },
                Trigger {
                    label: "Trigger".to_owned(),
                    key: "trigger".to_owned(),
                },
                Switch {
                    label: "Switch".to_owned(),
                    key: "switch".to_owned(),
                },
                DropDown {
                    key: "dropdown".to_owned(),
                    items: vec![
                        DropDownItem {
                            label: "Sine".to_owned(),
                            value: "sine".to_owned(),
                        },
                        DropDownItem {
                            label: "Square".to_owned(),
                            value: "square".to_owned(),
                        },
                    ],
                },
                Canvas {
                    key: "canvas".to_owned(),
                    size: [300.0, 100.0],
                },
            ],
        },
    ],
};

Re-exports

pub use Direction::*;
pub use Widget::*;

Structs

Config

The structure holding the whole configuration.

DropDownItem

An item listed in the DropDown widget.

NodeTemplate

The structure specifying format of a node.

Pin

The type describing the format of a single pin within a node.

Enums

Direction

The direction type specifying the orientation of node Pins.

Widget

Widgets are input dialogs shown on a node.