pub struct SSRuntimeInstanceSlot { /* private fields */ }Expand description
JS-friendly wrapper of InstanceSlot. Same conceptual flow as the C FFI:
- construct via
create, 2) callstepper frame with the resolved active event, child context, and timing, 3) ontransitioned == truecallplayon the child context: the slot configures the child for the new key without starting it, and an independent child never advances otherwise.
Implementations§
Source§impl SSRuntimeInstanceSlot
impl SSRuntimeInstanceSlot
pub fn create() -> SSRuntimeInstanceSlot
Sourcepub fn step(
&mut self,
ev: &WebEventInstanceInfo,
child_ctx: &mut SSRuntimeContext,
parent_frame: f32,
delta_seconds: f32,
parent_looped: bool,
) -> bool
pub fn step( &mut self, ev: &WebEventInstanceInfo, child_ctx: &mut SSRuntimeContext, parent_frame: f32, delta_seconds: f32, parent_looped: bool, ) -> bool
Advance one tick. ev is the event info returned by
SSRuntimeContext::get_active_event_instance (or built manually via
WebEventInstanceInfo). child_ctx must be the child runtime —
label resolution and frame stepping run against it.
Returns true if visible. Inspect transitioned, independent,
child_frame_no, child_looped via the corresponding getters.
pub fn transitioned(&self) -> bool
pub fn independent(&self) -> bool
pub fn child_frame_no(&self) -> f32
pub fn child_looped(&self) -> bool
pub fn is_independent(&self) -> bool
Sourcepub fn get_speed(&self) -> f32
pub fn get_speed(&self) -> f32
The speed the last step drove the child at. Scale the elapsed time
handed to the child’s own slots by its absolute value, not by the event’s
speed, which reads 1.0 while the slot ignores the implicit key. Mirrors
the C-API ss_instance_slot_get_speed.
Sourcepub fn reset(&mut self)
pub fn reset(&mut self)
Reset the slot’s “last started key” memory to its just-created state
without destroying it. Call on an explicit head-out (replay) so a
re-played animation re-fires the instance child from scratch instead of
debouncing the first key as the same one the slot last started. Mirrors
the C-API ss_instance_slot_reset.
Trait Implementations§
Source§impl From<SSRuntimeInstanceSlot> for JsValue
impl From<SSRuntimeInstanceSlot> for JsValue
Source§fn from(value: SSRuntimeInstanceSlot) -> Self
fn from(value: SSRuntimeInstanceSlot) -> Self
Source§impl FromWasmAbi for SSRuntimeInstanceSlot
impl FromWasmAbi for SSRuntimeInstanceSlot
Source§impl IntoWasmAbi for SSRuntimeInstanceSlot
impl IntoWasmAbi for SSRuntimeInstanceSlot
Source§impl LongRefFromWasmAbi for SSRuntimeInstanceSlot
impl LongRefFromWasmAbi for SSRuntimeInstanceSlot
Source§type Abi = WasmPtr<WasmRefCell<SSRuntimeInstanceSlot>>
type Abi = WasmPtr<WasmRefCell<SSRuntimeInstanceSlot>>
RefFromWasmAbi::AbiSource§type Anchor = RcRef<SSRuntimeInstanceSlot>
type Anchor = RcRef<SSRuntimeInstanceSlot>
RefFromWasmAbi::AnchorSource§unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn long_ref_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiSource§impl RefFromWasmAbi for SSRuntimeInstanceSlot
impl RefFromWasmAbi for SSRuntimeInstanceSlot
Source§type Abi = WasmPtr<WasmRefCell<SSRuntimeInstanceSlot>>
type Abi = WasmPtr<WasmRefCell<SSRuntimeInstanceSlot>>
Self are recovered from.Source§type Anchor = RcRef<SSRuntimeInstanceSlot>
type Anchor = RcRef<SSRuntimeInstanceSlot>
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 SSRuntimeInstanceSlot
impl RefMutFromWasmAbi for SSRuntimeInstanceSlot
Source§type Abi = WasmPtr<WasmRefCell<SSRuntimeInstanceSlot>>
type Abi = WasmPtr<WasmRefCell<SSRuntimeInstanceSlot>>
RefFromWasmAbi::AbiSource§type Anchor = RcRefMut<SSRuntimeInstanceSlot>
type Anchor = RcRefMut<SSRuntimeInstanceSlot>
RefFromWasmAbi::AnchorSource§unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
unsafe fn ref_mut_from_abi(js: Self::Abi) -> Self::Anchor
RefFromWasmAbi::ref_from_abiimpl SupportsConstructor for SSRuntimeInstanceSlot
impl SupportsInstanceProperty for SSRuntimeInstanceSlot
impl SupportsStaticProperty for SSRuntimeInstanceSlot
Source§impl TryFromJsValue for SSRuntimeInstanceSlot
impl TryFromJsValue for SSRuntimeInstanceSlot
Source§fn try_from_js_value_ref(value: &JsValue) -> Option<Self>
fn try_from_js_value_ref(value: &JsValue) -> Option<Self>
Source§const NULLABLE: bool = false
const NULLABLE: bool = false
Self accepts null as a distinct value space, as
Nullable<T> does. An enclosing Option then passes null through
instead of reading it as None, so Option<T> is itself nullable
exactly when T is not. JsValue does not set this: it accepts
null as one value among all of them, not as a distinct space, and
Option<JsValue> reads it as None like the ABI does. This is the
JS-value side of NullableFromWasmAbi, which claims null at the
ABI.Source§impl VectorFromWasmAbi for SSRuntimeInstanceSlot
impl VectorFromWasmAbi for SSRuntimeInstanceSlot
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[SSRuntimeInstanceSlot]>
Source§impl VectorIntoWasmAbi for SSRuntimeInstanceSlot
impl VectorIntoWasmAbi for SSRuntimeInstanceSlot
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[SSRuntimeInstanceSlot]>) -> Self::Abi
Source§impl WasmDescribeVector for SSRuntimeInstanceSlot
impl WasmDescribeVector for SSRuntimeInstanceSlot
Auto Trait Implementations§
impl Freeze for SSRuntimeInstanceSlot
impl RefUnwindSafe for SSRuntimeInstanceSlot
impl Send for SSRuntimeInstanceSlot
impl Sync for SSRuntimeInstanceSlot
impl Unpin for SSRuntimeInstanceSlot
impl UnsafeUnpin for SSRuntimeInstanceSlot
impl UnwindSafe for SSRuntimeInstanceSlot
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
Source§impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
impl<T> MaybeFromWasmAbi for Twhere
T: OptionFromWasmAbi,
Source§type MaybeAbi = <T as FromWasmAbi>::Abi
type MaybeAbi = <T as FromWasmAbi>::Abi
Option<Self>.Source§unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn from_maybe_abi(js: <T as FromWasmAbi>::Abi) -> T
unsafe fn try_from_maybe_abi( js: <T as FromWasmAbi>::Abi, ) -> Result<T, &'static str>
Source§impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
impl<T> MaybeIntoWasmAbi for Twhere
T: OptionIntoWasmAbi,
Source§type MaybeAbi = <T as IntoWasmAbi>::Abi
type MaybeAbi = <T as IntoWasmAbi>::Abi
Option<Self>.Source§fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
fn into_maybe_abi(self) -> <T as IntoWasmAbi>::Abi
Option<Self> ABI.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
IntoWasmAbi::AbiSource§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi, except that it may throw and never
return in the case of Err.