Skip to main content

sim_lib_view_device/
lib.rs

1//! Device profiles and timing loops for SIM Web surface capabilities.
2//!
3//! Surfaces still advertise open [`sim_lib_view::SurfaceCaps`] metadata. This
4//! crate adds the typed device view over that metadata: a timing envelope,
5//! an ordered tier ladder, a single tier derivation function, a deterministic
6//! [`FrameClock`] and [`AdapterLoop`], and degradation reasons when an observed
7//! route cannot provide every requested capability. It remains library-level
8//! surface logic; the kernel does not learn a device enum.
9
10#![deny(missing_docs)]
11
12pub mod adapter;
13pub mod clock;
14pub mod consent;
15pub mod degrade;
16pub mod glance;
17pub mod glance_adapter;
18pub mod ladder;
19pub mod r#loop;
20pub mod profile;
21mod profile_surface;
22pub mod rate;
23pub mod reaper;
24pub mod split;
25
26pub use adapter::{EncodedScene, LocalAdapter, MirrorAdapter};
27pub use clock::FrameClock;
28pub use consent::{
29    ConsentReceipt, DeviceCapability, EdgeId, record_consent_receipt, require_with_consent,
30};
31pub use degrade::{Degradation, DegradationResolver, ObservedRoute};
32pub use glance::{
33    AckChannel, GlanceBudget, GlanceInput, GlanceReducer, GlanceState, fit_to_budget,
34    reduce_scene_to_glance,
35};
36pub use glance_adapter::GlanceAdapter;
37pub use ladder::DeviceTier;
38pub use r#loop::{AdapterInput, AdapterLoop, Frame, StalePolicy, blank_frame};
39pub use profile::{
40    DEVICE_PROFILE_KIND, DEVICE_PROFILE_NAMESPACE, DeviceProfile, DeviceProfileError,
41    DeviceProfileParts, DeviceSurfaceCapsExt, derive_tier, device_profile_demo, tier_preset,
42};
43pub use rate::{RateClass, RateError};
44pub use reaper::{
45    DeviceSampleStore, Evicted, PrivacyMode, ReaperDirective, RetentionReaper, StoreKey,
46    StoredSample, retention_reason,
47};
48pub use split::{Split, SplitRun, drive};
49
50/// Embedded cookbook recipe books shipped with this library.
51pub static RECIPES: sim_cookbook::EmbeddedDir =
52    include!(concat!(env!("OUT_DIR"), "/cookbook_recipes.rs"));
53
54#[cfg(test)]
55mod profile_tests;
56
57#[cfg(test)]
58mod split_tests;
59
60#[cfg(test)]
61mod timing_tests;
62
63#[cfg(test)]
64mod glance_tests;
65
66#[cfg(test)]
67mod consent_tests;