pub struct WasmEngine { /* private fields */ }
Implementations§
Source§impl WasmEngine
impl WasmEngine
Sourcepub fn new(scene: WasmScene) -> WasmEngine
pub fn new(scene: WasmScene) -> WasmEngine
Create a new engine from an initial scene
Sourcepub fn get_active_scene(&self) -> Option<WasmScene>
pub fn get_active_scene(&self) -> Option<WasmScene>
Get the active scene
Sourcepub fn get_active_scene_mut(&mut self) -> Option<WasmScene>
pub fn get_active_scene_mut(&mut self) -> Option<WasmScene>
Get the active scene mutably
Sourcepub fn push_scene(&mut self, scene: WasmScene)
pub fn push_scene(&mut self, scene: WasmScene)
Push a new scene and set it active
Sourcepub fn rollback_to(&mut self, index: usize)
pub fn rollback_to(&mut self, index: usize)
Rollback timeline to a given index
Sourcepub fn rewind_to(&mut self, index: usize) -> Result<(), JsValue>
pub fn rewind_to(&mut self, index: usize) -> Result<(), JsValue>
Rewind to a specific index without truncating
Sourcepub fn get_scene_at(&self, index: usize) -> Option<WasmScene>
pub fn get_scene_at(&self, index: usize) -> Option<WasmScene>
Get a scene at a specific index
Sourcepub fn get_timeline(&self) -> Array
pub fn get_timeline(&self) -> Array
Get full timeline (cloned)
Sourcepub fn get_current_index(&self) -> usize
pub fn get_current_index(&self) -> usize
Get current time index
Trait Implementations§
Source§impl From<WasmEngine> for JsValue
impl From<WasmEngine> for JsValue
Source§fn from(value: WasmEngine) -> Self
fn from(value: WasmEngine) -> Self
Converts to this type from the input type.
Source§impl FromWasmAbi for WasmEngine
impl FromWasmAbi for WasmEngine
Source§impl IntoWasmAbi for WasmEngine
impl IntoWasmAbi for WasmEngine
Source§impl LongRefFromWasmAbi for WasmEngine
impl LongRefFromWasmAbi for WasmEngine
Source§impl OptionFromWasmAbi for WasmEngine
impl OptionFromWasmAbi for WasmEngine
Source§impl OptionIntoWasmAbi for WasmEngine
impl OptionIntoWasmAbi for WasmEngine
Source§impl RefFromWasmAbi for WasmEngine
impl RefFromWasmAbi for WasmEngine
Source§type Anchor = RcRef<WasmEngine>
type Anchor = RcRef<WasmEngine>
The type that holds the reference to
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl RefMutFromWasmAbi for WasmEngine
impl RefMutFromWasmAbi for WasmEngine
Source§impl TryFromJsValue for WasmEngine
impl TryFromJsValue for WasmEngine
Source§impl VectorFromWasmAbi for WasmEngine
impl VectorFromWasmAbi for WasmEngine
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[WasmEngine]>
Source§impl VectorIntoJsValue for WasmEngine
impl VectorIntoJsValue for WasmEngine
fn vector_into_jsvalue(vector: Box<[WasmEngine]>) -> JsValue
Source§impl VectorIntoWasmAbi for WasmEngine
impl VectorIntoWasmAbi for WasmEngine
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[WasmEngine]>) -> Self::Abi
Source§impl WasmDescribeVector for WasmEngine
impl WasmDescribeVector for WasmEngine
Source§impl WasmWrapper<Engine> for WasmEngine
impl WasmWrapper<Engine> for WasmEngine
Source§fn into_inner(self) -> Engine
fn into_inner(self) -> Engine
Consume the wrapper and return the inner type
Source§fn from_inner(inner: Engine) -> WasmEngine
fn from_inner(inner: Engine) -> WasmEngine
Create a new wrapper from the inner type
impl SupportsConstructor for WasmEngine
impl SupportsInstanceProperty for WasmEngine
impl SupportsStaticProperty for WasmEngine
Auto Trait Implementations§
impl Freeze for WasmEngine
impl RefUnwindSafe for WasmEngine
impl Send for WasmEngine
impl Sync for WasmEngine
impl Unpin for WasmEngine
impl UnwindSafe for WasmEngine
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
Mutably borrows from an owned value. Read more
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
Same as
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
Same as
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.