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 dev;
15pub mod envelope;
16pub mod inspector;
17pub mod metadata;
18pub mod packet;
19pub mod read_construct;
20pub mod security;
21pub mod shape;
22pub mod site;
23pub mod spine;
24
25/// Cookbook recipes for this crate, embedded at build time.
26///
27/// Holds the crate's `recipes/` directory as an in-binary
28/// [`sim_cookbook::EmbeddedDir`] so the runtime can surface stream-core
29/// examples without touching the filesystem.
30pub static RECIPES: sim_cookbook::EmbeddedDir =
31    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
32
33pub use bridge::{BridgeLatency, DomainBridgeDescriptor, DomainBridgeKind};
34pub use buffer::{BackpressureOutcome, BufferOverflowPolicy, BufferPolicy};
35pub use cassette::{
36    STREAM_CASSETTE_EXTENSION, STREAM_CASSETTE_FIXTURE_ROOT, StreamCassette, StreamCassetteTiming,
37    StreamGoldenFixtureReport, stream_cassette_format_symbol, stream_cassette_golden_extension,
38    stream_cassette_golden_root,
39};
40pub use citizen::{StreamPacketDescriptor, stream_packet_class_symbol};
41pub use dev::{
42    DevCassette, DevEvent, DevFaultReport, MediaDescriptor, dev_dropped_chunks_diagnostic,
43    dev_event_media, dev_event_metadata,
44};
45pub use envelope::{
46    ClockDomain, LatencyClass, STREAM_ENVELOPE_VERSION, StreamCapability, StreamEnvelope,
47    TransportProfile, stream_envelope_tag_symbol,
48};
49pub use inspector::{
50    StreamFaultKind, StreamFaultPlan, StreamFaultResult, StreamFaultSpec, StreamInspectorSnapshot,
51    StreamInspectorStatus, stream_fault_symbols, stream_inspector_model_symbol,
52    stream_inspector_route_local_symbol, stream_inspector_status_symbols,
53};
54pub use metadata::{
55    RateContract, StreamDirection, StreamMedia, StreamMetadata, publish_metadata_claims,
56    stream_buffer_predicate, stream_direction_predicate, stream_id_predicate,
57    stream_media_predicate,
58};
59pub use packet::{
60    DataPacket, MidiPacket, MidiPacketEvent, PcmPacket, PcmSampleFormat, StreamDiagnostic,
61    StreamPacket,
62};
63pub use read_construct::{
64    StreamMetadataValue, install_stream_core_classes, stream_metadata_class_symbol,
65};
66pub use security::{
67    StreamRedactionFinding, StreamRemoteLimits, StreamSecurityCapability, StreamSecurityPolicy,
68    stream_cancel_capability, stream_host_device_capability, stream_lan_midi_capability,
69    stream_open_capability, stream_push_capability, stream_read_capability,
70    stream_redaction_finding_symbols, stream_remote_network_capability,
71    stream_remote_preview_capability, stream_remote_render_capability,
72    stream_security_capabilities, stream_security_capability_names, stream_stats_capability,
73};
74pub use shape::{
75    StreamCoreShapesLib, install_stream_core_shapes_lib, stream_backpressure_shape_symbol,
76    stream_buffer_policy_shape_symbol, stream_capability_shape_symbol,
77    stream_clock_domain_shape_symbol, stream_clock_shape_symbol, stream_data_packet_shape_symbol,
78    stream_diagnostic_shape_symbol, stream_envelope_shape_symbol,
79    stream_latency_class_shape_symbol, stream_media_shape_symbol, stream_metadata_shape_symbol,
80    stream_packet_shape_symbol, stream_tempo_shape_symbol,
81};
82pub use site::{PlacedFragment, StreamEdge, StreamEndpoint, StreamEndpointKind, stream_edge};
83pub use spine::{
84    PushResult, StreamEventSource, StreamItem, StreamStats, StreamValue, stream_cancel_bang,
85    stream_cancel_symbol, stream_done_q, stream_done_symbol, stream_metadata,
86    stream_metadata_symbol, stream_next_bang, stream_next_symbol, stream_peek_bang,
87    stream_peek_symbol, stream_run_bang, stream_run_symbol, stream_stats, stream_stats_symbol,
88    stream_take, stream_take_symbol,
89};
90
91#[cfg(test)]
92mod bridge_tests;
93
94#[cfg(test)]
95mod dev_tests;
96
97#[cfg(test)]
98mod inspector_tests;
99
100#[cfg(test)]
101mod security_tests;
102
103#[cfg(test)]
104mod site_tests;
105
106#[cfg(test)]
107mod tests;