pub struct HostState {
pub pending_window_creations: VecDeque<PendingWindowCreation>,
pub browser_panes: HashMap<String, BrowserPaneEntry>,
pub browsers: HashMap<String, BrowserHandle>,
pub active_drag: Option<DragSession>,
pub pool: PoolState,
pub quit_state: QuitState,
pub top_level_creation: TopLevelCreationState,
pub window_opacities: HashMap<String, f32>,
pub lifecycle: HostLifecyclePhase,
pub event_version: u64,
}Expand description
State owned by the host reducer.
Held inside AppState.host_state: parking_lot::Mutex<HostState>.
Locked briefly by host_dispatch; never held across CEF callbacks
or SendMessage (snapshot-and-drop discipline — see spec §6).
Fields§
§pending_window_creations: VecDeque<PendingWindowCreation>FIFO queue of pre-create handoffs. Pushed by callers
(pane/creation.rs, commands/window.rs::open_new_window,
commands/drag.rs::tear_off, commands/window_pool.rs::spawn_pool_window)
before post_create_window. Popped by client.rs::on_after_created
when CEF reports a new browser. Peeked at the back by
wrr/win_event.rs::handle_event to label OS-level WM_CREATE
events with the upcoming label.
Invariants:
- At most one entry per (in-flight) browser create.
on_after_createdalways pops the head it expects to find.- The “main” window is special-cased in
on_after_createdand never has a corresponding entry here.
browser_panes: HashMap<String, BrowserPaneEntry>H.1 — pane lifecycle map. Replaces the deleted
pane::lifecycle::PaneStateMachine. Keyed by block_id.
Authoritative; BrowserPaneManager (browser_panes.rs) is now a
zero-sized handle that delegates all mutations through
host_dispatch.
browsers: HashMap<String, BrowserHandle>H.2 — browser handle registry. Replaces the deleted
AppState.browsers: Mutex<HashMap<String, Browser>>. Keyed by
label (e.g., window-..., browser-pane-..., window-pool-...).
Authoritative; read via AppState::get_browser, list_browsers, etc.
active_drag: Option<DragSession>H.3 — active drag session (singleton). Replaces the deleted
AppState.active_drag: Mutex<Option<DragSession>>.
pool: PoolStateH.4 — pool state (queue + unpromoted + in-flight semaphore +
just_promoted_labels bridge from PR #708). Replaces the deleted
window_pool / unpromoted_pool_labels fields on AppState.
quit_state: QuitStateH.5 — quit lifecycle. Replaces the deleted
AppState.is_quitting: AtomicBool.
top_level_creation: TopLevelCreationStateH.6 — top-level window creation runner state (queue, in-flight,
history). Event-driven; no watchdog. Currently DORMANT — the
reducer arms (EnqueueTopLevelWindow, TopLevelCallbackFired,
etc.) exist but no production code dispatches to them. The
ui_tasks::post_create_window direct-call path is still
authoritative. Wire-up is a low-priority structural improvement;
see master spec §4.3 and discussion #707.
window_opacities: HashMap<String, f32>Per-window opacity state. Keyed by label, value is clamped [0.0, 1.0].
Absent means fully opaque (1.0). Mutated by SetWindowOpacity; read by
get_window_opacity and the restore path in app-init. Win32 side-effect
(SetLayeredWindowAttributes) is applied by the IPC handler AFTER dispatch,
not inside the reducer. See SPEC_PER_WINDOW_OPACITY_2026-05-14.md §7.1.
lifecycle: HostLifecyclePhaseLifecycle phase. Running is the operating state; the others
gate command acceptance.
event_version: u64Monotonic event-version counter (per host-process run). Same invariant as launcher / srv reducers.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HostState
impl RefUnwindSafe for HostState
impl Send for HostState
impl Sync for HostState
impl Unpin for HostState
impl UnwindSafe for HostState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
impl<T, U> ConvertReturnValue<U> for Twhere
T: Into<U>,
fn wrap_result(self) -> U
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.