[][src]Enum rask_wasm::communication::message_queue::Message

#[repr(C, u32)]
#[non_exhaustive]pub enum Message {
    None,
    KeyDown(KeyModifieru32),
    KeyUp(KeyModifieru32),
    KeyPress(u32u16),
    MouseDown(MouseEvent),
    MouseUp(MouseEvent),
    TextMode(bool),
    EngineEvent(Event),
    RequestAlloc {
        id: u32,
        size: u32,
    },
    DoneWritingResource(u32),
    PushResource(u32),
    AllocatedBuffer {
        id: u32,
        ptr: u32,
    },
    FetchResource(u32, &'static str),
    PrepareAudio(u32, &'static str),
    AudioLoaded(u32),
    PlaySound(u32),
    StopSound(u32),
    Memory(u32u32u32),
}

Messages sent by the main.js.

Variants (Non-exhaustive)

Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
KeyDown(KeyModifieru32)
KeyUp(KeyModifieru32)
KeyPress(u32u16)
MouseDown(MouseEvent)
MouseUp(MouseEvent)
TextMode(bool)

Ask javascript to set the TextMode on or off.

EngineEvent(Event)

Wrapper for game events to be relayed to the server.

RequestAlloc

Fields of RequestAlloc

id: u32size: u32
DoneWritingResource(u32)
PushResource(u32)
AllocatedBuffer

Rust finshed allocating the requested buffer.

Fields of AllocatedBuffer

id: u32ptr: u32
FetchResource(u32, &'static str)

Ask javascript to fetch the requested resource. In response to this, javascript will fetch the resource and send a RequestAlloc Event. The rest follows the standard resource flow.

PrepareAudio(u32, &'static str)

Ask javascript to fetch the requested sound track.

AudioLoaded(u32)
PlaySound(u32)
StopSound(u32)
Memory(u32u32u32)

Send memory offsets to javascript.

Implementations

impl Message[src]

pub fn to_slice(&self) -> &[u32][src]

pub fn send(&self)[src]

Trait Implementations

impl Clone for Message[src]

impl Debug for Message[src]

impl Default for Message[src]

impl From<Message> for MessageQueueElement[src]

Auto Trait Implementations

impl RefUnwindSafe for Message

impl Send for Message

impl Sync for Message

impl Unpin for Message

impl UnwindSafe for Message

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Any for T where
    T: Any

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S, T> Collide<[T]> for S where
    T: Collide<S>, 
[src]

impl<T> Event for T where
    T: Send + Sync + 'static, 

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Resource for T where
    T: Any + Send + Sync

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> TryDefault for T where
    T: Default

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.