Skip to main content

tachyon_types/
lib.rs

1pub mod category;
2pub use category::*;
3
4pub mod inventory;
5pub use inventory::*;
6
7pub mod output;
8pub use output::*;
9
10pub mod playbook;
11pub use playbook::*;
12
13pub mod cluster;
14pub use cluster::*;
15
16pub mod pin;
17pub use pin::*;
18
19pub mod run;
20pub use run::*;
21
22pub mod resource;
23pub use resource::*;
24
25pub mod commands;
26pub use commands::*;
27
28/// Force the linker to keep every `#[myko_item]` / `#[myko_command]`
29/// registration in this crate.
30///
31/// Each entity and command self-registers via a static that the linker will
32/// drop (DCE) if nothing in the final binary references its module. The tachyon
33/// server binary references these types directly, but when tachyon-types is
34/// composed as a DEPENDENCY into another cell's server binary nothing
35/// references them, so without this the entities and commands would
36/// silently vanish from the composed cell. Call `tachyon_types::link()` once
37/// from the host cell during setup.
38///
39/// This list MUST stay exhaustive: every `#[myko_item]` and `#[myko_command]`
40/// in the crate needs a line below. Adding an entity or command without one
41/// drops it from any composed cell with no error.
42pub fn link() {
43    use std::hint::black_box;
44    // Entities (#[myko_item]).
45    black_box(std::any::type_name::<crate::Run>());
46    black_box(std::any::type_name::<crate::Playbook>());
47    black_box(std::any::type_name::<crate::ClusterDef>());
48    black_box(std::any::type_name::<crate::Category>());
49    black_box(std::any::type_name::<crate::Pin>());
50    black_box(std::any::type_name::<crate::OutputLine>());
51    black_box(std::any::type_name::<crate::Inventory>());
52    // Commands (#[myko_command]).
53    black_box(std::any::type_name::<crate::RunPlaybook>());
54    black_box(std::any::type_name::<crate::CancelRun>());
55    black_box(std::any::type_name::<crate::PinPlaybook>());
56    black_box(std::any::type_name::<crate::AppendRunOutput>());
57    black_box(std::any::type_name::<crate::FinishRun>());
58    black_box(std::any::type_name::<crate::DeclarePlaybooks>());
59    black_box(std::any::type_name::<crate::DeclareClusters>());
60}