euv-core 0.48.2

Core cross-platform runtime for euv featuring arena-based fine-grained reactivity, deterministic layout, flat scene graph, multi-mode rendering, and direct OS platform adapters.
Documentation
use super::*;

/// Strongly-typed logical instance slot identifier (locates a slot without inferring interface types).
#[derive(
    Clone, Data, Debug, Default, Deserialize, Eq, Hash, New, Ord, PartialEq, PartialOrd, Serialize,
)]
pub struct SlotKey {
    /// Logical slot identifier (e.g. `"product-card"`).
    pub(crate) key: String,
}

/// Structured compile-time component interface identity (`package:interface/vN`).
#[derive(
    Clone, Data, Debug, Default, Deserialize, Eq, Hash, New, Ord, PartialEq, PartialOrd, Serialize,
)]
pub struct ComponentInterfaceId {
    /// Canonical WIT / contract interface identifier string.
    pub(crate) id: String,
    /// Interface major version number.
    #[get(type(copy))]
    pub(crate) version: u32,
}

/// Reference strongly-typed Props struct for `ProductCardContract` (Sec 11.9).
#[derive(Clone, Data, Debug, Default, Deserialize, Eq, Hash, New, PartialEq, Serialize)]
pub struct ProductCardProps {
    /// Stable business product identifier.
    pub(crate) product_id: String,
    /// Current authoritative order quantity.
    #[get(type(copy))]
    pub(crate) quantity: u32,
}

/// Zero-sized contract marker type binding `ProductCardProps` and `ProductCardEvent` at compile time.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub struct ProductCardContract;

/// Snapshot of dynamic boundary activity counters verifying zero dynamic calls during steady-state rendering.
#[derive(Clone, Copy, Data, Debug, Default, Eq, Hash, New, PartialEq)]
pub struct DynamicFrameMetrics {
    /// Total dynamic Wasm or declarative module invocations performed.
    #[get(type(copy))]
    pub(crate) dynamic_module_calls: u64,
    /// Total cross-boundary Props/Event serializations performed.
    #[get(type(copy))]
    pub(crate) boundary_serializations: u64,
    /// Total manifest or slot-binding lookups performed.
    #[get(type(copy))]
    pub(crate) manifest_lookups: u64,
}

/// Resolved binding descriptor attaching a strongly-typed contract slot to a pinned implementation.
#[derive(Clone, Data, Debug, Eq, New, PartialEq)]
pub struct ResolvedContractBinding {
    /// Normalized route owning this binding.
    pub(crate) route: String,
    /// Logical slot key within the route.
    pub(crate) slot_key: SlotKey,
    /// Active pinned release generation identifier.
    #[get(type(copy))]
    pub(crate) generation_id: u64,
    /// Compile-time interface identifier verified against the artifact.
    pub(crate) interface_id: String,
    /// Interface major version verified against the artifact.
    #[get(type(copy))]
    pub(crate) interface_version: u32,
    /// Local UI state schema version declared by the active artifact.
    #[get(type(copy))]
    pub(crate) state_schema_version: u32,
    /// Backing execution mode and content address.
    pub(crate) source: DynamicBindingSource,
}