logic_mesh/base/output/
mod.rs

1// Copyright (c) 2022-2023, Radu Racariu.
2
3//!
4//! Defines the base output types and traits.
5//!
6
7pub mod base;
8pub mod props;
9
10use libhaystack::val::Value;
11
12use super::link::BaseLink;
13
14pub use base::BaseOutput;
15pub use props::OutputProps;
16
17pub trait Output: OutputProps {
18    type Writer: Clone;
19
20    /// Adds a link to this output
21    fn add_link(&mut self, link: BaseLink<Self::Writer>);
22
23    /// Set this output's value by
24    /// sending this value to all the registered links
25    /// of this output.
26    fn set(&mut self, value: Value);
27}