euv-core 0.46.1

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
/// Retention policy controlling how a routed page behaves when the user navigates away.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum PageRetention {
    /// Dispose the page subtree, reactive scope, and lifecycle resources on leave; recreate fresh on next visit.
    Destroy,
    /// Retain the scene subtree hidden (`Display::None`), freeze all reactive effects and animations while tracking cross-page dirty state, and coalesce updates atomically on resume.
    #[default]
    Freeze,
    /// Hide the page visually (`Display::None`) while keeping its reactive effects running in the background.
    Alive,
}

/// Lifecycle phase of a mounted `Component` or routed page managed by the framework.
#[derive(Clone, Copy, Debug, Default, Eq, Hash, PartialEq)]
pub enum LifecyclePhase {
    /// Component instance created, not yet mounted into the scene tree.
    #[default]
    Created,
    /// Component rendered and attached to the retained scene graph.
    Mounted,
    /// Component or page is actively visible and executing reactive logic.
    Active,
    /// Component or page is hidden with reactive effects suspended (`PageRetention::Freeze`).
    Frozen,
    /// Cold frozen page evicted under budget pressure while retaining a versioned `PageSnapshot` for deterministic restore.
    Evicted,
    /// Component detached from the scene graph prior to final disposal.
    Unmounted,
    /// Component scope disposed and resources released.
    Destroyed,
}

/// Distinct lifecycle boundary event separating OS background, surface loss, and route-level freeze semantics.
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum LifecycleBoundaryEvent {
    /// Host OS moved the application into background execution.
    OsBackground,
    /// Host OS returned the application to foreground execution.
    OsForeground,
    /// Graphics swapchain/surface was lost while keeping logical page state intact.
    SurfaceLost {
        /// Newly invalidated surface generation identifier.
        surface_generation: u64,
    },
    /// Graphics swapchain/surface was recreated ready for full redraw.
    SurfaceRecreated {
        /// Newly created surface generation identifier.
        surface_generation: u64,
    },
    /// Application router froze a page under `PageRetention::Freeze`.
    RouteFreeze {
        /// Target page identifier being frozen.
        page_id: u64,
    },
    /// Application router resumed a previously frozen or evicted page.
    RouteResume {
        /// Target page identifier being resumed.
        page_id: u64,
    },
}