pub struct AnimationRecorder { /* private fields */ }Expand description
Captures scalar animation values for later replay or DevTools export.
Implementations§
Source§impl AnimationRecorder
impl AnimationRecorder
Sourcepub fn new() -> AnimationRecorder
pub fn new() -> AnimationRecorder
Create an inactive empty recorder.
Sourcepub fn is_recording(&self) -> bool
pub fn is_recording(&self) -> bool
Return whether recording is active.
Sourcepub fn tracks(&self) -> &[RecordedTrack]
pub fn tracks(&self) -> &[RecordedTrack]
Recorded tracks.
Sourcepub fn record(&mut self, label: impl AsRef<str>, time: f32, value: f64)
pub fn record(&mut self, label: impl AsRef<str>, time: f32, value: f64)
Record one scalar sample if the recorder is active.
Sourcepub fn export_json(&self) -> String
pub fn export_json(&self) -> String
Export recorded data as deterministic JSON.
Sourcepub fn import_json(json: &str) -> Result<AnimationRecorder, RecorderError>
pub fn import_json(json: &str) -> Result<AnimationRecorder, RecorderError>
Import data previously produced by export_json.
Sourcepub fn export_binary(&self) -> Vec<u8> ⓘ
pub fn export_binary(&self) -> Vec<u8> ⓘ
Export recorded data as a compact deterministic binary format.
Sourcepub fn import_binary(bytes: &[u8]) -> Result<AnimationRecorder, RecorderError>
pub fn import_binary(bytes: &[u8]) -> Result<AnimationRecorder, RecorderError>
Import data previously produced by export_binary.
Trait Implementations§
Source§impl Clone for AnimationRecorder
impl Clone for AnimationRecorder
Source§fn clone(&self) -> AnimationRecorder
fn clone(&self) -> AnimationRecorder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AnimationRecorder
impl Debug for AnimationRecorder
Source§impl Default for AnimationRecorder
impl Default for AnimationRecorder
Source§fn default() -> AnimationRecorder
fn default() -> AnimationRecorder
Returns the “default value” for a type. Read more
Source§impl PartialEq for AnimationRecorder
impl PartialEq for AnimationRecorder
Source§fn eq(&self, other: &AnimationRecorder) -> bool
fn eq(&self, other: &AnimationRecorder) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for AnimationRecorder
Auto Trait Implementations§
impl Freeze for AnimationRecorder
impl RefUnwindSafe for AnimationRecorder
impl Send for AnimationRecorder
impl Sync for AnimationRecorder
impl Unpin for AnimationRecorder
impl UnsafeUnpin for AnimationRecorder
impl UnwindSafe for AnimationRecorder
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