pub enum HostCommand {
Show 26 variants
EnqueuePendingWindowCreation {
entry: PendingWindowCreation,
},
DequeuePendingWindowCreation,
EnqueueBrowserPaneCreate {
block_id: String,
label: String,
},
TryRegisterBrowserPaneLive {
block_id: String,
},
CompleteBrowserPaneCreate {
block_id: String,
},
EnqueueBrowserPaneClose {
block_id: String,
},
CompleteBrowserPaneClose {
block_id: String,
},
DrainBrowserPaneByLabel {
label: String,
},
AbortBrowserPaneCreate {
block_id: String,
reason: String,
},
RegisterBrowser {
label: String,
browser: Browser,
kind: BrowserKind,
},
UnregisterBrowser {
label: String,
},
StartDrag {
session: DragSession,
},
EndDrag {
drag_id: String,
outcome: DragOutcome,
},
PoolWindowSpawnStart {
label: String,
},
PoolWindowReady {
label: String,
},
PoolWindowDestroyedBeforePromote {
label: String,
},
PromotePoolWindow {
label: String,
},
PopAndPromoteFrontPoolWindow,
PoolDrainAll,
BeginDrain {
reason: QuitReason,
},
ConfirmDrained,
EnqueueTopLevelWindow {
request: TopLevelCreationRequest,
},
TopLevelCallbackFired {
label: String,
},
TopLevelRendererTerminated {
label: String,
status: String,
},
TopLevelExternallyClosed {
label: String,
},
SetWindowOpacity {
label: String,
opacity: f32,
},
}Expand description
Commands handled by the host reducer.
Manual Debug impl below because RegisterBrowser carries a
cef::Browser which doesn’t impl Debug.
Variants§
EnqueuePendingWindowCreation
Append a pending-window-creation handoff. Producer side of the
pending_window_creations queue (replaces the four direct
state.pending_window_creations.lock().push_back(...) sites).
Fields
entry: PendingWindowCreationDequeuePendingWindowCreation
Pop the head of pending_window_creations. Returns the popped
entry via HostEvent::PendingWindowDequeued, or
HostEvent::PendingWindowQueueEmpty if the queue was empty.
Consumer side of the queue (replaces
client.rs::on_after_created’s direct pop_front).
EnqueueBrowserPaneCreate
Caller (pane create code) requests a new pane lifecycle entry.
Reducer inserts with Live. Reject if block_id already present.
TryRegisterBrowserPaneLive
PR #5 — sole pane registration entry point post-H.1.d.
Replaces pane::lifecycle::PaneStateMachine::try_register_live.
Reducer generates the label internally (via next_browser_pane_label) so
label assignment is atomic with the entry insert. Returns the
outcome via DispatchOutput::browser_pane_register_result:
Fresh(label): newLiveentry inserted; caller posts CreateBrowserPaneTaskAlreadyLive(label): caller should re-navigate existing browserClosing: caller must reject (old teardown still in flight)
CompleteBrowserPaneCreate
CEF on_after_created fired for a pane browser; confirm it’s Live. No-op if already Live or absent (idempotent against late callbacks).
EnqueueBrowserPaneClose
Caller requests pane close. Reducer flips entry to Closing and
returns the entry’s label via DispatchOutput::closed_browser_pane_label
iff the transition actually fired (was Live). Returns None for
missing or already-Closing entries (idempotent).
CompleteBrowserPaneClose
CEF on_before_close fired for a pane; remove entry from map.
DrainBrowserPaneByLabel
PR #5 — sole label-keyed drain entry point post-H.1.d.
Replaces pane::lifecycle::PaneStateMachine::drain_by_label. Used
by BrowserPaneManager::drain_closed_label when CEF’s
on_before_close fires for a pane. Removes the entry whose label
matches; returns the drained block_id via
DispatchOutput::drained_browser_pane_block_id so the caller can also dispatch
any block_id-keyed cleanup. Idempotent (None if no match).
AbortBrowserPaneCreate
Pane creation failed before reaching Live (e.g., CEF callback never fired, browser host returned 0). Reducer removes entry.
RegisterBrowser
Insert browser into browsers map. Caller is on the CEF UI thread
(e.g., client.rs::on_after_created). Reject (with Error) if label
already present (collision indicates a bug).
UnregisterBrowser
Remove browser from browsers map. Idempotent; no-op if absent.
StartDrag
Begin a cross-window drag session. Reject if one is already active (singleton invariant).
Fields
session: DragSessionEndDrag
End the active drag. drag_id must match the current session.
PoolWindowSpawnStart
Pool window spawn started. Adds label to unpromoted set; sets
respawn_in_flight = true if not already.
PoolWindowReady
Frontend signaled the pool window’s renderer is fully initialized.
Move from unpromoted to queue; clear respawn_in_flight.
PoolWindowDestroyedBeforePromote
Pool window was destroyed before renderer-ready (e.g., user
closed it externally during pre-warm). Remove from unpromoted,
clear respawn_in_flight. Reducer may emit a refill effect.
PromotePoolWindow
Promote a pool window into a user-visible top-level. Removes from
queue and unpromoted, marks the corresponding BrowserHandle
as is_pool: false.
PopAndPromoteFrontPoolWindow
PR #5 H.4 — atomic pop+promote front of pool queue. Returns the
popped label via DispatchOutput::promoted_pool_label, or None
if the queue is empty. Replaces the legacy
state.window_pool.lock().pop_front() + state.unpromoted_pool_labels.lock().remove
pair in promote_pool_window.
PoolDrainAll
Drain all pool windows on shutdown. Idempotent.
BeginDrain
Transition Running → Draining. Suppresses pool refills, awaits drain completion.
Fields
reason: QuitReasonConfirmDrained
All drainable resources are gone (pool empty, browsers empty). Transition Draining → Quit.
EnqueueTopLevelWindow
Caller requests a top-level window. Reducer either:
- rejects (User-initiated + busy) with Error; caller propagates visible error to frontend.
- queues (Background) for later auto-advance.
- starts immediately (idle slot) and emits
Effect::PostCreateWindow.
Fields
request: TopLevelCreationRequestTopLevelCallbackFired
CEF on_after_created fired for label. If matches in-flight,
mark Completed and advance queue. If doesn’t match (orphan from
stale state), emit Effect::CloseOrphanBrowser.
TopLevelRendererTerminated
CEF on_render_process_terminated fired for the renderer process
associated with label. If matches in-flight, mark Failed and
advance queue.
TopLevelExternallyClosed
CEF on_before_close fired for label while still in-flight.
User or external code closed the window mid-creation. Mark Failed.
SetWindowOpacity
Set per-window opacity. Reducer stores the clamped value in
window_opacities; the IPC handler applies the Win32 side-effect
after host_dispatch returns (pure reducer, no I/O inside).
Trait Implementations§
Source§impl Clone for HostCommand
impl Clone for HostCommand
Source§fn clone(&self) -> HostCommand
fn clone(&self) -> HostCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for HostCommand
impl RefUnwindSafe for HostCommand
impl Send for HostCommand
impl Sync for HostCommand
impl Unpin for HostCommand
impl UnwindSafe for HostCommand
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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.