[−][src]Struct rask_wasm::communication::synchronization_memory::SynchronizationMemory
The SynchronizationMemory is the main interface to the main.js
.
It exposes some variables from the main.js
and is used for the atomic wait cycle.
Fields
elapsed_ms: i32
Time elapsed since logic thread initialisation in milliseconds.
mouse: (i32, i32)
Current mouse position.
canvas_size: (u32, u32)
Canvas size in px.
player: GameState
other: GameState
Implementations
impl SynchronizationMemory
[src]
The synchronization memory is a direct memory interface to the main.js
.
It is updated before each logic cycle.
pub const fn new() -> Self
[src]
pub fn wait_for_main_thread_notify(&mut self)
[src]
This functions lets the thread sleep until it is woken up by the main.js
or a timeout is
reached.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for SynchronizationMemory
impl Send for SynchronizationMemory
impl Sync for SynchronizationMemory
impl Unpin for SynchronizationMemory
impl UnwindSafe for SynchronizationMemory
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
fn get_type_id(&self) -> TypeId
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<S, T> Collide<[T]> for S where
T: Collide<S>,
[src]
T: Collide<S>,
impl<T> Event for T where
T: Send + Sync + 'static,
T: Send + Sync + 'static,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Pointable for T
const ALIGN: usize
type Init = T
The type for initializers.
unsafe fn init(init: <T as Pointable>::Init) -> usize
unsafe fn deref<'a>(ptr: usize) -> &'a T
unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
unsafe fn drop(ptr: usize)
impl<T> Resource for T where
T: Any + Send + Sync,
T: Any + Send + Sync,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,