Skip to main content

Command

Enum Command 

Source
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

§callback_id: u64

Identifier supplied by the requester when the asset was requested.

§payload: Box<dyn Any + Send>

Decoded payload (image bytes, etc.) typed by the consumer.

§

NetworkResponse

Carries an HTTP response payload.

Fields

§callback_id: u64

Identifier supplied at request time.

§status: u16

HTTP status code.

§body: Vec<u8>

Response body bytes.

§

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.

Fields

§key: PropertyKey

Target property key.

§value: PropertyValue

New value to write.

§

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

§type_id: TypeId

Concrete payload type id used to route the command to its registered handler.

§payload: Box<dyn Any + Send>

Boxed payload.

§

Custom(Box<dyn Any + Send>)

Free-form variant retained for backward compatibility with callers that have not yet migrated to Self::Typed.

Auto Trait Implementations§

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.

§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
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> ConditionalSend for T
where T: Send,