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::*;

/// 24-byte, 8-byte-aligned inline buffer holding either a small `T` directly or a spilled `*mut T`.
#[repr(C, align(8))]
pub(crate) struct SboStorage {
    /// Uninitialized aligned 24-byte word storage preserving padding and pointer provenance.
    pub(crate) words: [MaybeUninit<u64>; 3],
}

/// Static type-erased dispatch table for a concrete value stored inside `SignalSlot`.
#[derive(Clone, Copy)]
pub(crate) struct SignalVTable {
    /// Returns the runtime `TypeId` of the stored concrete type `T`.
    pub(crate) type_id: fn() -> TypeId,
    /// Drops the stored value in place (inline `drop_in_place` or spilled `Box::from_raw`).
    pub(crate) drop_fn: unsafe fn(*mut SboStorage),
    /// Whether the concrete type `T` is stored inline inside `SboStorage`.
    pub(crate) is_inline: bool,
}

/// 32-byte small-buffer-optimized type-erased payload slot avoiding heap allocation for `<= 24 B`, `align <= 8` values.
pub(crate) struct SignalSlot {
    /// Inline 24-byte aligned buffer holding `T` directly or a `Box::into_raw` pointer `*mut T`.
    pub(crate) storage: SboStorage,
    /// Active type dispatch table; `None` indicates an empty or disposed slot.
    pub(crate) vtable: Option<&'static SignalVTable>,
    /// Marks `SignalSlot` as `!Send` and `!Sync` because stored payloads only require `'static`.
    pub(crate) marker: PhantomData<*mut ()>,
}