pub struct TimeDataMap<T> {
pub values: BTreeMap<Time, T>,
}Expand description
A mapping from time to data values with interpolation support.
Stores time-value pairs in a BTreeMap for efficient time-based
queries and supports various interpolation methods.
When the interpolation feature is enabled, each value can have an
associated interpolation specification for animation curves.
Without interpolation feature: BTreeMap<Time, T>.
With interpolation feature an entry supports a [Key]s:
BTreeMap<Time, (T, Option<Key<T>>)>.
Fields§
§values: BTreeMap<Time, T>The time-value pairs with optional interpolation keys.
Implementations§
Source§impl<T> TimeDataMap<T>
impl<T> TimeDataMap<T>
Source§impl<T> TimeDataMap<T>
impl<T> TimeDataMap<T>
Source§impl<T> TimeDataMap<T>
impl<T> TimeDataMap<T>
pub fn interpolate(&self, time: Time) -> T
Source§impl<T> TimeDataMap<T>
impl<T> TimeDataMap<T>
pub fn closest_sample(&self, time: Time) -> &T
Sourcepub fn sample_at(&self, time: Time) -> Option<&T>
pub fn sample_at(&self, time: Time) -> Option<&T>
Sample value at exact time (no interpolation).
Sourcepub fn sample_at_or_before(&self, time: Time) -> Option<&T>
pub fn sample_at_or_before(&self, time: Time) -> Option<&T>
Get the value at or before the given time.
Sourcepub fn sample_at_or_after(&self, time: Time) -> Option<&T>
pub fn sample_at_or_after(&self, time: Time) -> Option<&T>
Get the value at or after the given time.
Trait Implementations§
Source§impl<T> AnimatedDataOps for TimeDataMap<T>
impl<T> AnimatedDataOps for TimeDataMap<T>
Source§impl<T> AsRef<BTreeMap<Tick, T>> for TimeDataMap<T>
Available on non-crate feature interpolation only.
impl<T> AsRef<BTreeMap<Tick, T>> for TimeDataMap<T>
Available on non-crate feature
interpolation only.Source§impl<T: Clone> Clone for TimeDataMap<T>
impl<T: Clone> Clone for TimeDataMap<T>
Source§fn clone(&self) -> TimeDataMap<T>
fn clone(&self) -> TimeDataMap<T>
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<T> DataTypeOps for TimeDataMap<T>where
T: DataTypeOps,
impl<T> DataTypeOps for TimeDataMap<T>where
T: DataTypeOps,
Source§impl<T: Debug> Debug for TimeDataMap<T>
impl<T: Debug> Debug for TimeDataMap<T>
Source§impl From<(Tick, BooleanVec)> for TimeDataMap<BooleanVec>
impl From<(Tick, BooleanVec)> for TimeDataMap<BooleanVec>
Source§fn from((time, value): (Time, BooleanVec)) -> Self
fn from((time, value): (Time, BooleanVec)) -> Self
Converts to this type from the input type.
Source§impl From<(Tick, IntegerVec)> for TimeDataMap<IntegerVec>
impl From<(Tick, IntegerVec)> for TimeDataMap<IntegerVec>
Source§fn from((time, value): (Time, IntegerVec)) -> Self
fn from((time, value): (Time, IntegerVec)) -> Self
Converts to this type from the input type.
Source§impl From<(Tick, Matrix3Vec)> for TimeDataMap<Matrix3Vec>
impl From<(Tick, Matrix3Vec)> for TimeDataMap<Matrix3Vec>
Source§fn from((time, value): (Time, Matrix3Vec)) -> Self
fn from((time, value): (Time, Matrix3Vec)) -> Self
Converts to this type from the input type.
Source§impl From<(Tick, Vector2Vec)> for TimeDataMap<Vector2Vec>
impl From<(Tick, Vector2Vec)> for TimeDataMap<Vector2Vec>
Source§fn from((time, value): (Time, Vector2Vec)) -> Self
fn from((time, value): (Time, Vector2Vec)) -> Self
Converts to this type from the input type.
Source§impl From<TimeDataMap<Boolean>> for AnimatedData
impl From<TimeDataMap<Boolean>> for AnimatedData
Source§fn from(v: TimeDataMap<Boolean>) -> AnimatedData
fn from(v: TimeDataMap<Boolean>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<BooleanVec>> for AnimatedData
impl From<TimeDataMap<BooleanVec>> for AnimatedData
Source§fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData
fn from(v: TimeDataMap<BooleanVec>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Color>> for AnimatedData
impl From<TimeDataMap<Color>> for AnimatedData
Source§fn from(v: TimeDataMap<Color>) -> AnimatedData
fn from(v: TimeDataMap<Color>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<ColorVec>> for AnimatedData
impl From<TimeDataMap<ColorVec>> for AnimatedData
Source§fn from(v: TimeDataMap<ColorVec>) -> AnimatedData
fn from(v: TimeDataMap<ColorVec>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Integer>> for AnimatedData
impl From<TimeDataMap<Integer>> for AnimatedData
Source§fn from(v: TimeDataMap<Integer>) -> AnimatedData
fn from(v: TimeDataMap<Integer>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<IntegerVec>> for AnimatedData
impl From<TimeDataMap<IntegerVec>> for AnimatedData
Source§fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData
fn from(v: TimeDataMap<IntegerVec>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Matrix3>> for AnimatedData
Available on crate feature matrix3 only.
impl From<TimeDataMap<Matrix3>> for AnimatedData
Available on crate feature
matrix3 only.Source§fn from(v: TimeDataMap<Matrix3>) -> AnimatedData
fn from(v: TimeDataMap<Matrix3>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Matrix3Vec>> for AnimatedData
Available on crate features matrix3 and vec_variants only.
impl From<TimeDataMap<Matrix3Vec>> for AnimatedData
Available on crate features
matrix3 and vec_variants only.Source§fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData
fn from(v: TimeDataMap<Matrix3Vec>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Real>> for AnimatedData
impl From<TimeDataMap<Real>> for AnimatedData
Source§fn from(v: TimeDataMap<Real>) -> AnimatedData
fn from(v: TimeDataMap<Real>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<RealVec>> for AnimatedData
impl From<TimeDataMap<RealVec>> for AnimatedData
Source§fn from(v: TimeDataMap<RealVec>) -> AnimatedData
fn from(v: TimeDataMap<RealVec>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<String>> for AnimatedData
impl From<TimeDataMap<String>> for AnimatedData
Source§fn from(v: TimeDataMap<String>) -> AnimatedData
fn from(v: TimeDataMap<String>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<StringVec>> for AnimatedData
impl From<TimeDataMap<StringVec>> for AnimatedData
Source§fn from(v: TimeDataMap<StringVec>) -> AnimatedData
fn from(v: TimeDataMap<StringVec>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Vector2>> for AnimatedData
Available on crate feature vector2 only.
impl From<TimeDataMap<Vector2>> for AnimatedData
Available on crate feature
vector2 only.Source§fn from(v: TimeDataMap<Vector2>) -> AnimatedData
fn from(v: TimeDataMap<Vector2>) -> AnimatedData
Converts to this type from the input type.
Source§impl From<TimeDataMap<Vector2Vec>> for AnimatedData
Available on crate features vector2 and vec_variants only.
impl From<TimeDataMap<Vector2Vec>> for AnimatedData
Available on crate features
vector2 and vec_variants only.Source§fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData
fn from(v: TimeDataMap<Vector2Vec>) -> AnimatedData
Converts to this type from the input type.
Source§impl<T, V> FromIterator<(Tick, V)> for TimeDataMap<T>where
V: Into<T>,
impl<T, V> FromIterator<(Tick, V)> for TimeDataMap<T>where
V: Into<T>,
Source§impl<T: Hash> Hash for TimeDataMap<T>
impl<T: Hash> Hash for TimeDataMap<T>
Source§impl<T: PartialEq> PartialEq for TimeDataMap<T>
impl<T: PartialEq> PartialEq for TimeDataMap<T>
Source§impl Sample<Color> for TimeDataMap<Color>
impl Sample<Color> for TimeDataMap<Color>
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Color, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Color, SampleWeight)>>
Generate samples across the shutter interval. Read more
Source§impl Sample<Integer> for TimeDataMap<Integer>
impl Sample<Integer> for TimeDataMap<Integer>
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Integer, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Integer, SampleWeight)>>
Generate samples across the shutter interval. Read more
Source§impl Sample<Matrix3> for TimeDataMap<Matrix3>
Available on crate feature matrix3 only.
impl Sample<Matrix3> for TimeDataMap<Matrix3>
Available on crate feature
matrix3 only.Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Matrix3, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Matrix3, SampleWeight)>>
Generate samples across the shutter interval. Read more
Source§impl Sample<Real> for TimeDataMap<Real>
impl Sample<Real> for TimeDataMap<Real>
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Real, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Real, SampleWeight)>>
Generate samples across the shutter interval. Read more
Source§impl Sample<Vector2> for TimeDataMap<Vector2>
impl Sample<Vector2> for TimeDataMap<Vector2>
Source§fn sample(
&self,
shutter: &Shutter,
samples: NonZeroU16,
) -> Result<Vec<(Vector2, SampleWeight)>>
fn sample( &self, shutter: &Shutter, samples: NonZeroU16, ) -> Result<Vec<(Vector2, SampleWeight)>>
Generate samples across the shutter interval. Read more
Source§impl<T> TimeDataMapControl<T> for TimeDataMap<T>
impl<T> TimeDataMapControl<T> for TimeDataMap<T>
Source§impl TryInto<TimeDataMap<Boolean>> for AnimatedData
impl TryInto<TimeDataMap<Boolean>> for AnimatedData
Source§impl TryInto<TimeDataMap<BooleanVec>> for AnimatedData
impl TryInto<TimeDataMap<BooleanVec>> for AnimatedData
Source§fn try_into(
self,
) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<BooleanVec>, <Self as TryInto<TimeDataMap<BooleanVec>>>::Error>
Performs the conversion.
Source§impl TryInto<TimeDataMap<Color>> for AnimatedData
impl TryInto<TimeDataMap<Color>> for AnimatedData
Source§impl TryInto<TimeDataMap<ColorVec>> for AnimatedData
impl TryInto<TimeDataMap<ColorVec>> for AnimatedData
Source§impl TryInto<TimeDataMap<Integer>> for AnimatedData
impl TryInto<TimeDataMap<Integer>> for AnimatedData
Source§impl TryInto<TimeDataMap<IntegerVec>> for AnimatedData
impl TryInto<TimeDataMap<IntegerVec>> for AnimatedData
Source§fn try_into(
self,
) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<IntegerVec>, <Self as TryInto<TimeDataMap<IntegerVec>>>::Error>
Performs the conversion.
Source§impl TryInto<TimeDataMap<Matrix3>> for AnimatedData
Available on crate feature matrix3 only.
impl TryInto<TimeDataMap<Matrix3>> for AnimatedData
Available on crate feature
matrix3 only.Source§impl TryInto<TimeDataMap<Matrix3Vec>> for AnimatedData
Available on crate features matrix3 and vec_variants only.
impl TryInto<TimeDataMap<Matrix3Vec>> for AnimatedData
Available on crate features
matrix3 and vec_variants only.Source§fn try_into(
self,
) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<Matrix3Vec>, <Self as TryInto<TimeDataMap<Matrix3Vec>>>::Error>
Performs the conversion.
Source§impl TryInto<TimeDataMap<Real>> for AnimatedData
impl TryInto<TimeDataMap<Real>> for AnimatedData
Source§impl TryInto<TimeDataMap<RealVec>> for AnimatedData
impl TryInto<TimeDataMap<RealVec>> for AnimatedData
Source§impl TryInto<TimeDataMap<String>> for AnimatedData
impl TryInto<TimeDataMap<String>> for AnimatedData
Source§impl TryInto<TimeDataMap<StringVec>> for AnimatedData
impl TryInto<TimeDataMap<StringVec>> for AnimatedData
Source§impl TryInto<TimeDataMap<Vector2>> for AnimatedData
Available on crate feature vector2 only.
impl TryInto<TimeDataMap<Vector2>> for AnimatedData
Available on crate feature
vector2 only.Source§impl TryInto<TimeDataMap<Vector2Vec>> for AnimatedData
Available on crate features vector2 and vec_variants only.
impl TryInto<TimeDataMap<Vector2Vec>> for AnimatedData
Available on crate features
vector2 and vec_variants only.Source§fn try_into(
self,
) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>
fn try_into( self, ) -> Result<TimeDataMap<Vector2Vec>, <Self as TryInto<TimeDataMap<Vector2Vec>>>::Error>
Performs the conversion.
impl<T: Eq> Eq for TimeDataMap<T>
impl<T> StructuralPartialEq for TimeDataMap<T>
Auto Trait Implementations§
impl<T> Freeze for TimeDataMap<T>
impl<T> RefUnwindSafe for TimeDataMap<T>where
T: RefUnwindSafe,
impl<T> Send for TimeDataMap<T>where
T: Send,
impl<T> Sync for TimeDataMap<T>where
T: Sync,
impl<T> Unpin for TimeDataMap<T>
impl<T> UnwindSafe for TimeDataMap<T>where
T: RefUnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.