pub struct AnimationDiagnostic {
pub error: AnimationError,
pub index: Option<usize>,
}Expand description
An authoring error with the zero-based position of the offending key/frame.
index is None only for empty input. For unordered keys it identifies the
second key of the first non-increasing adjacent pair. Invalid keys take
precedence over ordering errors, just as in Track::new.
use ferravex_play::animation::{AnimationError, Keyframe, ScalarTrack};
let keys = [Keyframe { time: 1.0, value: 2.0 }; 2];
let diagnostic = ScalarTrack::validate_keys(&keys).unwrap_err();
assert_eq!(diagnostic.error, AnimationError::UnorderedKeys);
assert_eq!(diagnostic.index, Some(1));Fields§
§error: AnimationErrorThe error category returned by the existing constructor.
index: Option<usize>Offending key/frame index, or None for empty input.
Trait Implementations§
Source§impl Clone for AnimationDiagnostic
impl Clone for AnimationDiagnostic
Source§fn clone(&self) -> AnimationDiagnostic
fn clone(&self) -> AnimationDiagnostic
Returns a duplicate of the value. Read more
1.0.0 · 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 AnimationDiagnostic
impl Debug for AnimationDiagnostic
Source§impl PartialEq for AnimationDiagnostic
impl PartialEq for AnimationDiagnostic
impl Copy for AnimationDiagnostic
impl Eq for AnimationDiagnostic
impl StructuralPartialEq for AnimationDiagnostic
Auto Trait Implementations§
impl Freeze for AnimationDiagnostic
impl RefUnwindSafe for AnimationDiagnostic
impl Send for AnimationDiagnostic
impl Sync for AnimationDiagnostic
impl Unpin for AnimationDiagnostic
impl UnwindSafe for AnimationDiagnostic
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