pub enum Command {
AssetLoaded {
callback_id: u64,
payload: Box<dyn Any + Send>,
},
NetworkResponse {
callback_id: u64,
status: u16,
body: Vec<u8>,
},
ScriptUpdate(Box<dyn Any + Send>),
SetProperty {
key: PropertyKey,
value: PropertyValue,
},
Typed {
type_id: TypeId,
payload: Box<dyn Any + Send>,
},
Custom(Box<dyn Any + Send>),
}Expand description
A deferred command applied during TickStage::CommandDrain.
Variants§
AssetLoaded
Carries an asynchronously decoded asset payload.
Fields
NetworkResponse
Carries an HTTP response payload.
Fields
ScriptUpdate(Box<dyn Any + Send>)
Carries a script-produced state mutation.
SetProperty
Writes a typed value into the PropertyStore.
Drained in TickStage::CommandDrain via apply_property_commands.
The per-App queue is the intended home for external property writes, but the global EXTERNAL_TX /
EXTERNAL_RX ring in property_store is still what the C-ABI crate and the async tasks use; this variant has
no producer yet.
Typed
Strongly-typed custom command, dispatched via CommandRegistry.
Replaces blind Custom(Box<dyn Any>) downcasts: the receiving plugin registers a handler
for its concrete payload type with crate::app::App::register_command and the drain
dispatches by TypeId.
Fields
Custom(Box<dyn Any + Send>)
Free-form variant retained for backward compatibility with callers that have not yet migrated to Self::Typed.