pub struct FrameIndex<T>(/* private fields */);Expand description
Represents a frame index.
Implementations§
Source§impl<T> FrameIndex<T>
impl<T> FrameIndex<T>
Sourcepub fn new(value: T) -> Self
pub fn new(value: T) -> Self
Creates a new FrameIndex from the given value.
Sourcepub fn into_index(self) -> T
pub fn into_index(self) -> T
Consumes this FrameIndex value and returns the inner frame value.
Sourcepub fn from_time<S>(time: Time<S>, rate: FrameRate<S>) -> Self
pub fn from_time<S>(time: Time<S>, rate: FrameRate<S>) -> Self
Creates a FrameIndex from Time at the specified FrameRate.
Sourcepub fn to_time<S>(self, rate: FrameRate<S>) -> Time<S>
pub fn to_time<S>(self, rate: FrameRate<S>) -> Time<S>
Converts this FrameIndex to Time at the specified FrameRate.
Sourcepub fn offset_from(self, other: Self) -> <T as SignedEquivalent>::Signedwhere
T: SignedEquivalent + SignedCast<<T as SignedEquivalent>::Signed>,
<T as SignedEquivalent>::Signed: Sub<Output = <T as SignedEquivalent>::Signed>,
pub fn offset_from(self, other: Self) -> <T as SignedEquivalent>::Signedwhere
T: SignedEquivalent + SignedCast<<T as SignedEquivalent>::Signed>,
<T as SignedEquivalent>::Signed: Sub<Output = <T as SignedEquivalent>::Signed>,
Returns the signed frame offset from this index to another index. The result is positive when self is ahead of other, negative when behind, and zero when equal.
Sourcepub fn next(&self) -> Self
pub fn next(&self) -> Self
Returns the next FrameIndex, saturating at T::MAX.
Sourcepub fn previous(&self) -> Self
pub fn previous(&self) -> Self
Returns the previous FrameIndex, saturating at T::MIN.
Source§impl<T> FrameIndex<T>where
T: BoundedMin,
impl<T> FrameIndex<T>where
T: BoundedMin,
Source§impl<T> FrameIndex<T>where
T: BoundedMax,
impl<T> FrameIndex<T>where
T: BoundedMax,
Source§impl<T> FrameIndex<T>where
T: MinMax,
impl<T> FrameIndex<T>where
T: MinMax,
Source§impl<T> FrameIndex<T>where
T: SaturatingAdd<Output = T>,
impl<T> FrameIndex<T>where
T: SaturatingAdd<Output = T>,
Sourcepub fn saturating_add(self, rhs: Self) -> Self
pub fn saturating_add(self, rhs: Self) -> Self
Returns the result of saturating addition of two FrameIndex values.
Sourcepub fn saturating_add_t(self, rhs: T) -> Self
pub fn saturating_add_t(self, rhs: T) -> Self
Returns the result of saturating addition of a FrameIndex value and a raw frame value.
Source§impl<T> FrameIndex<T>where
T: SaturatingSub<Output = T>,
impl<T> FrameIndex<T>where
T: SaturatingSub<Output = T>,
Sourcepub fn saturating_sub(self, rhs: Self) -> Self
pub fn saturating_sub(self, rhs: Self) -> Self
Returns the result of saturating subtraction of two FrameIndex values.
Sourcepub fn saturating_sub_t(self, rhs: T) -> Self
pub fn saturating_sub_t(self, rhs: T) -> Self
Returns the result of saturating subtraction of a FrameIndex value and a raw frame value.
Trait Implementations§
Source§impl<T> Add for FrameIndex<T>where
T: Add<Output = T>,
impl<T> Add for FrameIndex<T>where
T: Add<Output = T>,
Source§impl<T> Add<T> for FrameIndex<T>where
T: Add<Output = T>,
impl<T> Add<T> for FrameIndex<T>where
T: Add<Output = T>,
Source§impl<T> AddAssign for FrameIndex<T>where
T: AddAssign,
impl<T> AddAssign for FrameIndex<T>where
T: AddAssign,
Source§fn add_assign(&mut self, rhs: Self)
fn add_assign(&mut self, rhs: Self)
+= operation. Read moreSource§impl<T> AddAssign<T> for FrameIndex<T>where
T: AddAssign,
impl<T> AddAssign<T> for FrameIndex<T>where
T: AddAssign,
Source§fn add_assign(&mut self, rhs: T)
fn add_assign(&mut self, rhs: T)
+= operation. Read moreSource§impl<T> ApproxEqAbs for FrameIndex<T>where
T: Copy + ApproxEqAbs<Tolerance = T>,
impl<T> ApproxEqAbs for FrameIndex<T>where
T: Copy + ApproxEqAbs<Tolerance = T>,
Source§const DEFAULT_TOLERANCE_ABS: Self::Tolerance = <T as ::rinia::algebra::ApproxEqAbs>::DEFAULT_TOLERANCE_ABS
const DEFAULT_TOLERANCE_ABS: Self::Tolerance = <T as ::rinia::algebra::ApproxEqAbs>::DEFAULT_TOLERANCE_ABS
Source§fn approx_eq_abs_tol(self, other: Self, tol: Self::Tolerance) -> bool
fn approx_eq_abs_tol(self, other: Self, tol: Self::Tolerance) -> bool
Source§fn approx_eq_abs(self, other: Rhs) -> boolwhere
Self: Sized,
fn approx_eq_abs(self, other: Rhs) -> boolwhere
Self: Sized,
Source§impl<T> ApproxEqRel for FrameIndex<T>where
T: Copy + ApproxEqRel<Tolerance = T>,
impl<T> ApproxEqRel for FrameIndex<T>where
T: Copy + ApproxEqRel<Tolerance = T>,
Source§const DEFAULT_TOLERANCE_REL: Self::Tolerance = <T as ::rinia::algebra::ApproxEqRel>::DEFAULT_TOLERANCE_REL
const DEFAULT_TOLERANCE_REL: Self::Tolerance = <T as ::rinia::algebra::ApproxEqRel>::DEFAULT_TOLERANCE_REL
Source§fn approx_eq_rel_tol(self, other: Self, tol: Self::Tolerance) -> bool
fn approx_eq_rel_tol(self, other: Self, tol: Self::Tolerance) -> bool
Source§fn approx_eq_rel(self, other: Rhs) -> boolwhere
Self: Sized,
fn approx_eq_rel(self, other: Rhs) -> boolwhere
Self: Sized,
Source§impl<T> BoundedMax for FrameIndex<T>where
T: BoundedMax,
impl<T> BoundedMax for FrameIndex<T>where
T: BoundedMax,
Source§impl<T> BoundedMin for FrameIndex<T>where
T: BoundedMin,
impl<T> BoundedMin for FrameIndex<T>where
T: BoundedMin,
Source§impl<T: Clone> Clone for FrameIndex<T>
impl<T: Clone> Clone for FrameIndex<T>
Source§fn clone(&self) -> FrameIndex<T>
fn clone(&self) -> FrameIndex<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<T: Copy> Copy for FrameIndex<T>
Source§impl<T: Debug> Debug for FrameIndex<T>
impl<T: Debug> Debug for FrameIndex<T>
Source§impl<T> Default for FrameIndex<T>where
Self: Zero,
impl<T> Default for FrameIndex<T>where
Self: Zero,
Source§impl From<FrameIndex<u32>> for u32
impl From<FrameIndex<u32>> for u32
Source§fn from(frame: FrameIndex<u32>) -> Self
fn from(frame: FrameIndex<u32>) -> Self
Source§impl From<FrameIndex<u64>> for u64
impl From<FrameIndex<u64>> for u64
Source§fn from(frame: FrameIndex<u64>) -> Self
fn from(frame: FrameIndex<u64>) -> Self
Source§impl From<FrameIndex<usize>> for usize
impl From<FrameIndex<usize>> for usize
Source§fn from(frame: FrameIndex<usize>) -> Self
fn from(frame: FrameIndex<usize>) -> Self
Source§impl<T> From<T> for FrameIndex<T>
impl<T> From<T> for FrameIndex<T>
Source§impl<T> MinMax for FrameIndex<T>where
T: MinMax,
impl<T> MinMax for FrameIndex<T>where
T: MinMax,
Source§impl<T: PartialEq> PartialEq for FrameIndex<T>
impl<T: PartialEq> PartialEq for FrameIndex<T>
Source§impl<T: PartialOrd> PartialOrd for FrameIndex<T>
impl<T: PartialOrd> PartialOrd for FrameIndex<T>
Source§impl<T> SaturatingAdd for FrameIndex<T>where
T: SaturatingAdd<Output = T>,
impl<T> SaturatingAdd for FrameIndex<T>where
T: SaturatingAdd<Output = T>,
Source§type Output = FrameIndex<T>
type Output = FrameIndex<T>
Source§fn saturating_add(self, rhs: Self) -> Self::Output
fn saturating_add(self, rhs: Self) -> Self::Output
self and rhs.Source§impl<T> SaturatingAdd<T> for FrameIndex<T>where
T: SaturatingAdd<Output = T>,
impl<T> SaturatingAdd<T> for FrameIndex<T>where
T: SaturatingAdd<Output = T>,
Source§type Output = FrameIndex<T>
type Output = FrameIndex<T>
Source§fn saturating_add(self, rhs: T) -> Self::Output
fn saturating_add(self, rhs: T) -> Self::Output
self and rhs.Source§impl<T> SaturatingSub for FrameIndex<T>where
T: SaturatingSub<Output = T>,
impl<T> SaturatingSub for FrameIndex<T>where
T: SaturatingSub<Output = T>,
Source§type Output = FrameIndex<T>
type Output = FrameIndex<T>
Source§fn saturating_sub(self, rhs: Self) -> Self::Output
fn saturating_sub(self, rhs: Self) -> Self::Output
self and rhs.Source§impl<T> SaturatingSub<T> for FrameIndex<T>where
T: SaturatingSub<Output = T>,
impl<T> SaturatingSub<T> for FrameIndex<T>where
T: SaturatingSub<Output = T>,
Source§type Output = FrameIndex<T>
type Output = FrameIndex<T>
Source§fn saturating_sub(self, rhs: T) -> Self::Output
fn saturating_sub(self, rhs: T) -> Self::Output
self and rhs.impl<T: PartialEq> StructuralPartialEq for FrameIndex<T>
Source§impl<T> Sub for FrameIndex<T>where
T: Sub<Output = T>,
impl<T> Sub for FrameIndex<T>where
T: Sub<Output = T>,
Source§impl<T> Sub<T> for FrameIndex<T>where
T: Sub<Output = T>,
impl<T> Sub<T> for FrameIndex<T>where
T: Sub<Output = T>,
Source§impl<T> SubAssign for FrameIndex<T>where
T: SubAssign,
impl<T> SubAssign for FrameIndex<T>where
T: SubAssign,
Source§fn sub_assign(&mut self, rhs: Self)
fn sub_assign(&mut self, rhs: Self)
-= operation. Read moreSource§impl<T> SubAssign<T> for FrameIndex<T>where
T: SubAssign,
impl<T> SubAssign<T> for FrameIndex<T>where
T: SubAssign,
Source§fn sub_assign(&mut self, rhs: T)
fn sub_assign(&mut self, rhs: T)
-= operation. Read moreAuto Trait Implementations§
impl<T> Freeze for FrameIndex<T>where
T: Freeze,
impl<T> RefUnwindSafe for FrameIndex<T>where
T: RefUnwindSafe,
impl<T> Send for FrameIndex<T>where
T: Send,
impl<T> Sync for FrameIndex<T>where
T: Sync,
impl<T> Unpin for FrameIndex<T>where
T: Unpin,
impl<T> UnsafeUnpin for FrameIndex<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for FrameIndex<T>where
T: UnwindSafe,
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, U> LossyCastFrom<T> for Uwhere
T: LossyCast<U>,
impl<T, U> LossyCastFrom<T> for Uwhere
T: LossyCast<U>,
Source§fn lossy_cast_from(value: T) -> U
fn lossy_cast_from(value: T) -> U
value to type Self, potentially losing information.Source§impl<T, U> SaturatingCastFrom<T> for Uwhere
T: SaturatingCast<U>,
impl<T, U> SaturatingCastFrom<T> for Uwhere
T: SaturatingCast<U>,
Source§fn saturating_cast_from(value: T) -> U
fn saturating_cast_from(value: T) -> U
value to type Self, saturating the value if it is out of range.Source§impl<T, U> SignedCastFrom<T> for Uwhere
T: SignedCast<U>,
impl<T, U> SignedCastFrom<T> for Uwhere
T: SignedCast<U>,
Source§fn signed_cast_from(value: T) -> U
fn signed_cast_from(value: T) -> U
value to type Self, which is the signed equivalent of the original type.Source§impl<T, U> TryCastFrom<T> for Uwhere
T: TryCast<U>,
impl<T, U> TryCastFrom<T> for Uwhere
T: TryCast<U>,
Source§fn try_cast_from(value: T) -> Result<U, CastError>
fn try_cast_from(value: T) -> Result<U, CastError>
value to type Self.Source§impl<T, U> TryExactCastFrom<T> for Uwhere
T: TryExactCast<U>,
impl<T, U> TryExactCastFrom<T> for Uwhere
T: TryExactCast<U>,
Source§fn try_exact_cast_from(value: T) -> Result<U, CastError>
fn try_exact_cast_from(value: T) -> Result<U, CastError>
value to type Self without loss of information.Source§impl<T, U> UnsignedCastFrom<T> for Uwhere
T: UnsignedCast<U>,
impl<T, U> UnsignedCastFrom<T> for Uwhere
T: UnsignedCast<U>,
Source§fn unsigned_cast_from(value: T) -> U
fn unsigned_cast_from(value: T) -> U
value to type Self, which is the unsigned equivalent of the original type.