pub struct MotionRuntime { /* private fields */ }Implementations§
Source§impl MotionRuntime
impl MotionRuntime
pub fn new(preference: MotionPreference) -> Self
pub fn set_preference(&mut self, preference: MotionPreference)
pub fn request_preference(&mut self, preference: MotionPreference)
pub const fn preference(&self) -> MotionPreference
pub fn set_quality(&mut self, quality: MotionQuality)
pub const fn quality(&self) -> MotionQuality
Sourcepub fn start(
&mut self,
component: ComponentInstancePath,
source: MotionSource,
now: Instant,
) -> Result<MotionKey, MotionError>
pub fn start( &mut self, component: ComponentInstancePath, source: MotionSource, now: Instant, ) -> Result<MotionKey, MotionError>
Start or retarget a keyed animation at the sampled current value.
§Errors
Returns MotionError for non-finite values or invalid spring
parameters.
Sourcepub fn start_with_replay(
&mut self,
component: ComponentInstancePath,
declaration: MotionSource,
replay_key: Option<String>,
now: Instant,
) -> Result<MotionKey, MotionError>
pub fn start_with_replay( &mut self, component: ComponentInstancePath, declaration: MotionSource, replay_key: Option<String>, now: Instant, ) -> Result<MotionKey, MotionError>
Start or retarget while including an explicit declarative replay key.
§Errors
Returns MotionError for an invalid source.
pub fn cancel(&mut self, key: &MotionKey)
Sourcepub fn start_timeline(
&mut self,
component: ComponentInstancePath,
spec: MotionTimeline,
now: Instant,
) -> Result<MotionHandle, MotionError>
pub fn start_timeline( &mut self, component: ComponentInstancePath, spec: MotionTimeline, now: Instant, ) -> Result<MotionHandle, MotionError>
Register or replace a named timeline in one retained node scope.
§Errors
Returns an invalid timeline error before changing the active registry.
Sourcepub fn play_timeline(
&mut self,
handle: &MotionHandle,
now: Instant,
) -> Result<(), MotionError>
pub fn play_timeline( &mut self, handle: &MotionHandle, now: Instant, ) -> Result<(), MotionError>
Sourcepub fn pause_timeline(
&mut self,
handle: &MotionHandle,
now: Instant,
) -> Result<(), MotionError>
pub fn pause_timeline( &mut self, handle: &MotionHandle, now: Instant, ) -> Result<(), MotionError>
Pause a timeline at its current deterministic clock position.
§Errors
Returns MotionError::UnknownTimeline for a stale handle.
Sourcepub fn seek_timeline(
&mut self,
handle: &MotionHandle,
position_ms: u64,
now: Instant,
) -> Result<(), MotionError>
pub fn seek_timeline( &mut self, handle: &MotionHandle, position_ms: u64, now: Instant, ) -> Result<(), MotionError>
Seek to an absolute timeline position in milliseconds.
§Errors
Returns a stale-handle or invalid-position error.
Sourcepub fn restart_timeline(
&mut self,
handle: &MotionHandle,
now: Instant,
) -> Result<(), MotionError>
pub fn restart_timeline( &mut self, handle: &MotionHandle, now: Instant, ) -> Result<(), MotionError>
Restart a timeline from zero and enter the playing state.
§Errors
Returns MotionError::UnknownTimeline for a stale handle.
Sourcepub fn cancel_timeline(
&mut self,
handle: &MotionHandle,
) -> Result<(), MotionError>
pub fn cancel_timeline( &mut self, handle: &MotionHandle, ) -> Result<(), MotionError>
Cancel a timeline and enqueue one post-frame cancellation event.
§Errors
Returns MotionError::UnknownTimeline for a stale handle.
pub fn timeline_state( &self, handle: &MotionHandle, ) -> Option<MotionPlaybackState>
Sourcepub fn timeline_handle_for_owner(
&self,
domain: &str,
owner: &ComponentInstancePath,
incarnation: ComponentIncarnation,
generation: ScriptGeneration,
name: &str,
) -> Result<MotionHandle, MotionError>
pub fn timeline_handle_for_owner( &self, domain: &str, owner: &ComponentInstancePath, incarnation: ComponentIncarnation, generation: ScriptGeneration, name: &str, ) -> Result<MotionHandle, MotionError>
Resolve one unique named timeline below a view root.
§Errors
Returns an explicit error for missing or duplicate names.
pub fn drain_timeline_events(&mut self) -> Vec<MotionTimelineEvent>
pub fn drain_timeline_events_for_domain( &mut self, domain: &str, ) -> Vec<MotionTimelineEvent>
pub fn resource_usage(&self) -> MotionResourceUsage
pub fn retain_keys(&mut self, keys: &BTreeSet<MotionKey>)
pub fn retain_node_scope(&mut self, path: &str, keys: &BTreeSet<MotionKey>)
pub fn retain_timeline_scope( &mut self, path: &str, handles: &BTreeSet<MotionHandle>, )
pub fn cancel_node_scope(&mut self, path: &str)
pub fn is_node_scope_active(&self, path: &str) -> bool
pub fn suspend_node_scope(&mut self, path: &str, now: Instant)
pub fn resume_node_scope(&mut self, path: &str, now: Instant)
Sourcepub fn delay_node_scope(&mut self, path: &str, delay: Duration)
pub fn delay_node_scope(&mut self, path: &str, delay: Duration)
Compatibility for internal callers that already measured a pause.
pub fn snapshot(&self, now: Instant) -> BTreeMap<MotionKey, f64>
pub fn inspect(&self, now: Instant) -> Vec<MotionSnapshot>
pub fn inspect_timelines(&self, now: Instant) -> Vec<MotionTimelineSnapshot>
pub fn sample(&self, key: &MotionKey, now: Instant) -> Option<f64>
pub fn tick(&mut self, now: Instant) -> MotionFrame
pub fn tick_scope(&mut self, now: Instant, path: &str) -> MotionFrame
Trait Implementations§
Source§impl Debug for MotionRuntime
impl Debug for MotionRuntime
Auto Trait Implementations§
impl !RefUnwindSafe for MotionRuntime
impl !Send for MotionRuntime
impl !Sync for MotionRuntime
impl !UnwindSafe for MotionRuntime
impl Freeze for MotionRuntime
impl Unpin for MotionRuntime
impl UnsafeUnpin for MotionRuntime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().