Struct RuntimeInner

Source
pub struct RuntimeInner<A> {
Show 14 fields pub states: Rc<RefCell<StateStore>>, pub actions: Vec<A>, pub dirty_elements: HashMap<ElementTreeId, HashMap<ElementId, Invalidation>>, pub clipboard: Rc<dyn ClipboardProvider>, pub external_url_opener: Rc<dyn ExternalUrlOpener>, pub open_url_errors: Vec<OpenUrlError>, pub close_requested: bool, pub window_chrome_ops: Vec<(LogicalWindowId, WindowChromeOp)>, pub pending_focus_keys: HashMap<ElementTreeId, String>, pub presentation_scopes: HashMap<ElementTreeId, (LogicalWindowId, PresentationGeneration)>, pub popup_portal: Rc<RefCell<PopupPortal<A>>>, pub popup_ids_by_element: HashMap<(ElementTreeId, ElementId), PopupId>, pub popup_intents: Vec<PopupIntent>, pub popup_errors: Vec<PopupPortalError>, /* private fields */
}
Expand description

Shared mutable storage behind every RuntimeHandle clone.

This low-level type is public for provider integrations but is normally accessed through handle methods. Public collections span every retained-tree namespace sharing the value. The type is UI-thread-local and intended to remain behind Rc<RefCell<_>>; direct mutation can bypass coalescing, diagnostics, error recording, and cleanup invariants.

§Examples

use ailloli_ui_runtime::app::RuntimeInner;
let inner = RuntimeInner::<String>::new();
assert!(inner.actions.is_empty());
assert!(!inner.close_requested);

Fields§

§states: Rc<RefCell<StateStore>>

Shared type-erased retained component-state slots.

§actions: Vec<A>

Global FIFO application actions awaiting a host drain.

§dirty_elements: HashMap<ElementTreeId, HashMap<ElementId, Invalidation>>

Coalesced tree-local invalidations keyed by retained element.

§clipboard: Rc<dyn ClipboardProvider>

Active shared clipboard provider.

§external_url_opener: Rc<dyn ExternalUrlOpener>

Active shared validated external-URL opener.

§open_url_errors: Vec<OpenUrlError>

FIFO URL-opening failures not yet drained.

§close_requested: bool

Close requested; consumed by winit via take_close_requested.

§window_chrome_ops: Vec<(LogicalWindowId, WindowChromeOp)>

Pending minimize/maximize per logical window id (Window::new("main")).

§pending_focus_keys: HashMap<ElementTreeId, String>

Last pending focus key per retained-tree namespace.

§presentation_scopes: HashMap<ElementTreeId, (LogicalWindowId, PresentationGeneration)>

Current logical window/generation per retained-tree namespace.

§popup_portal: Rc<RefCell<PopupPortal<A>>>

Shared popup registry and z-order authority.

§popup_ids_by_element: HashMap<(ElementTreeId, ElementId), PopupId>

Stable popup ID reservation per tree-local owner element.

§popup_intents: Vec<PopupIntent>

Global FIFO backend-facing popup intents.

§popup_errors: Vec<PopupPortalError>

FIFO errors recorded by handle popup helpers.

Implementations§

Source§

impl<A> RuntimeInner<A>

Constructors for raw shared runtime storage.

Source

pub fn new() -> Self

Creates empty shared state with deterministic in-memory providers.

Service IDs start at one, popup IDs start at one inside the portal, and allocated tree namespaces start at zero. No capacity limit is imposed on the runtime-owned queues/maps apart from the bounded diagnostics ring.

§Examples
use ailloli_ui_runtime::app::{ClipboardProvider, RuntimeInner};
let inner = RuntimeInner::<()>::new();
assert_eq!(inner.clipboard.read_text().as_deref(), Some(""));
assert!(inner.dirty_elements.is_empty() && inner.popup_errors.is_empty());

Trait Implementations§

Source§

impl<A> Default for RuntimeInner<A>

Delegates to RuntimeInner::new.

Source§

fn default() -> Self

Returns fresh empty shared runtime state.

Auto Trait Implementations§

§

impl<A> Freeze for RuntimeInner<A>

§

impl<A> !RefUnwindSafe for RuntimeInner<A>

§

impl<A> !Send for RuntimeInner<A>

§

impl<A> !Sync for RuntimeInner<A>

§

impl<A> Unpin for RuntimeInner<A>
where A: Unpin,

§

impl<A> !UnwindSafe for RuntimeInner<A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,