Skip to main content

sim_lib_stream_core/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(missing_docs)]
3//! Core stream envelopes, metadata, packets, and buffer values.
4//!
5//! This crate is intentionally small: it defines the in-memory value surface
6//! that later stream clock, lazy-spine, media, and file crates build on. Packet
7//! observation uses kernel event helpers and refs; no server frame kind or
8//! media hook is hardwired into the kernel.
9
10pub mod bridge;
11pub mod buffer;
12pub mod cassette;
13mod citizen;
14pub mod cookbook;
15pub mod dev;
16pub mod envelope;
17pub mod inspector;
18pub mod metadata;
19pub mod packet;
20pub mod read_construct;
21pub mod security;
22pub mod shape;
23pub mod site;
24pub mod spine;
25pub mod time;
26
27/// Cookbook recipes for this crate, embedded at build time.
28///
29/// Holds the crate's `recipes/` directory as an in-binary
30/// [`sim_cookbook::EmbeddedDir`] so the runtime can surface stream-core
31/// examples without touching the filesystem.
32pub static RECIPES: sim_cookbook::EmbeddedDir =
33    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
34
35pub use bridge::{BridgeLatency, DomainBridgeDescriptor, DomainBridgeKind};
36pub use buffer::{BackpressureOutcome, BufferOverflowPolicy, BufferPolicy};
37pub use cassette::{
38    STREAM_CASSETTE_EXTENSION, STREAM_CASSETTE_FIXTURE_ROOT, StreamCassette, StreamCassetteTiming,
39    StreamGoldenFixtureReport, stream_cassette_format_symbol, stream_cassette_golden_extension,
40    stream_cassette_golden_root,
41};
42pub use citizen::{StreamPacketDescriptor, stream_packet_class_symbol};
43pub use cookbook::metadata_descriptor_demo;
44pub use dev::{
45    DevCassette, DevEvent, DevFaultReport, MediaDescriptor, dev_dropped_chunks_diagnostic,
46    dev_event_media, dev_event_metadata,
47};
48pub use envelope::{
49    ClockDomain, LatencyClass, STREAM_ENVELOPE_VERSION, StreamCapability, StreamEnvelope,
50    TransportProfile, stream_envelope_tag_symbol,
51};
52pub use inspector::{
53    StreamFaultKind, StreamFaultPlan, StreamFaultResult, StreamFaultSpec, StreamInspectorSnapshot,
54    StreamInspectorStatus, stream_fault_symbols, stream_inspector_model_symbol,
55    stream_inspector_route_local_symbol, stream_inspector_status_symbols,
56};
57pub use metadata::{
58    RateContract, StreamDirection, StreamMedia, StreamMetadata, publish_metadata_claims,
59    stream_buffer_predicate, stream_direction_predicate, stream_id_predicate,
60    stream_media_predicate,
61};
62pub use packet::{
63    DataPacket, MidiPacket, MidiPacketEvent, PcmPacket, PcmSampleFormat, StreamDiagnostic,
64    StreamPacket,
65};
66pub use read_construct::{
67    StreamMetadataValue, install_stream_core_classes, stream_metadata_class_symbol,
68};
69pub use security::{
70    StreamRedactionFinding, StreamRemoteLimits, StreamSecurityCapability, StreamSecurityPolicy,
71    stream_cancel_capability, stream_host_device_capability, stream_lan_midi_capability,
72    stream_open_capability, stream_push_capability, stream_read_capability,
73    stream_redaction_finding_symbols, stream_remote_network_capability,
74    stream_remote_preview_capability, stream_remote_render_capability,
75    stream_security_capabilities, stream_security_capability_names, stream_stats_capability,
76};
77pub use shape::{
78    StreamCoreShapesLib, install_stream_core_shapes_lib, stream_backpressure_shape_symbol,
79    stream_buffer_policy_shape_symbol, stream_capability_shape_symbol,
80    stream_clock_domain_shape_symbol, stream_clock_shape_symbol, stream_data_packet_shape_symbol,
81    stream_diagnostic_shape_symbol, stream_envelope_shape_symbol,
82    stream_latency_class_shape_symbol, stream_media_shape_symbol, stream_metadata_shape_symbol,
83    stream_packet_shape_symbol, stream_tempo_shape_symbol,
84};
85pub use site::{PlacedFragment, StreamEdge, StreamEndpoint, StreamEndpointKind, stream_edge};
86pub use spine::{
87    PushResult, StreamEventSource, StreamItem, StreamStats, StreamValue, stream_cancel_bang,
88    stream_cancel_symbol, stream_done_q, stream_done_symbol, stream_metadata,
89    stream_metadata_symbol, stream_next_bang, stream_next_symbol, stream_peek_bang,
90    stream_peek_symbol, stream_run_bang, stream_run_symbol, stream_stats, stream_stats_symbol,
91    stream_take, stream_take_symbol,
92};
93pub use time::{
94    CLOCK_INDEX_REF_NAMESPACE, ClockTickIndex, clock_index_ref, clock_index_symbol,
95    tick_clock_index,
96};
97
98#[cfg(test)]
99mod bridge_tests;
100
101#[cfg(test)]
102mod dev_tests;
103
104#[cfg(test)]
105mod inspector_tests;
106
107#[cfg(test)]
108mod security_tests;
109
110#[cfg(test)]
111mod shape_tests;
112
113#[cfg(test)]
114mod site_tests;
115
116#[cfg(test)]
117mod tests;