Struct reaper_medium::PositionInSeconds
source · [−]#[repr(transparent)]pub struct PositionInSeconds(_);
Expand description
This represents a position expressed as amount of seconds.
Sometimes this is a negative number, e.g. when it’s a position on the timeline and a metronome count-in is used or at the very beginning of the project (maybe because of rounding). Negative project start values don’t seem to cause negative position values though.
Implementations
sourceimpl PositionInSeconds
impl PositionInSeconds
sourcepub const ZERO: PositionInSeconds = _
pub const ZERO: PositionInSeconds = _
Position at 0.0 seconds. E.g. start of project, measure, etc. depending on the context.
sourcepub fn new(value: f64) -> PositionInSeconds
pub fn new(value: f64) -> PositionInSeconds
sourcepub unsafe fn new_unchecked(value: f64) -> PositionInSeconds
pub unsafe fn new_unchecked(value: f64) -> PositionInSeconds
Creates a PositionInSeconds value without bound checking.
Safety
You must ensure that the given value is a non-special number.
sourcepub fn rem_euclid(self, rhs: DurationInSeconds) -> DurationInSeconds
pub fn rem_euclid(self, rhs: DurationInSeconds) -> DurationInSeconds
See f64::rem_euclid
.
sourcepub fn abs(self) -> DurationInSeconds
pub fn abs(self) -> DurationInSeconds
Computes the absolute value, returning a duration.
Trait Implementations
sourceimpl Add<DurationInSeconds> for PositionInSeconds
impl Add<DurationInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
+
operator.sourcefn add(self, rhs: DurationInSeconds) -> Self
fn add(self, rhs: DurationInSeconds) -> Self
Performs the
+
operation. Read moresourceimpl Add<PositionInSeconds> for PositionInSeconds
impl Add<PositionInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
+
operator.sourceimpl Add<f64> for PositionInSeconds
impl Add<f64> for PositionInSeconds
sourceimpl Clone for PositionInSeconds
impl Clone for PositionInSeconds
sourcefn clone(&self) -> PositionInSeconds
fn clone(&self) -> PositionInSeconds
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for PositionInSeconds
impl Debug for PositionInSeconds
sourceimpl Default for PositionInSeconds
impl Default for PositionInSeconds
sourcefn default() -> PositionInSeconds
fn default() -> PositionInSeconds
Returns the “default value” for a type. Read more
sourceimpl Display for PositionInSeconds
impl Display for PositionInSeconds
sourceimpl Div<DurationInSeconds> for PositionInSeconds
impl Div<DurationInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
/
operator.sourcefn div(self, rhs: DurationInSeconds) -> Self::Output
fn div(self, rhs: DurationInSeconds) -> Self::Output
Performs the
/
operation. Read moresourceimpl From<DurationInSeconds> for PositionInSeconds
impl From<DurationInSeconds> for PositionInSeconds
sourcefn from(v: DurationInSeconds) -> Self
fn from(v: DurationInSeconds) -> Self
Converts to this type from the input type.
sourceimpl Mul<f64> for PositionInSeconds
impl Mul<f64> for PositionInSeconds
sourceimpl Neg for PositionInSeconds
impl Neg for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
-
operator.sourceimpl Ord for PositionInSeconds
impl Ord for PositionInSeconds
1.21.0 · sourceconst fn max(self, other: Self) -> Self
const fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourceconst fn min(self, other: Self) -> Self
const fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourceconst fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
const fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<DurationInSeconds> for PositionInSeconds
impl PartialEq<DurationInSeconds> for PositionInSeconds
sourcefn eq(&self, other: &DurationInSeconds) -> bool
fn eq(&self, other: &DurationInSeconds) -> bool
sourceimpl PartialEq<PositionInSeconds> for PositionInSeconds
impl PartialEq<PositionInSeconds> for PositionInSeconds
sourcefn eq(&self, other: &PositionInSeconds) -> bool
fn eq(&self, other: &PositionInSeconds) -> bool
sourceimpl PartialOrd<DurationInSeconds> for PositionInSeconds
impl PartialOrd<DurationInSeconds> for PositionInSeconds
sourcefn partial_cmp(&self, other: &DurationInSeconds) -> Option<Ordering>
fn partial_cmp(&self, other: &DurationInSeconds) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl PartialOrd<PositionInSeconds> for PositionInSeconds
impl PartialOrd<PositionInSeconds> for PositionInSeconds
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
1.0.0 · sourceconst fn le(&self, other: &Rhs) -> bool
const fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresourceimpl Rem<DurationInSeconds> for PositionInSeconds
impl Rem<DurationInSeconds> for PositionInSeconds
type Output = Option<PositionInSeconds>
type Output = Option<PositionInSeconds>
The resulting type after applying the
%
operator.sourcefn rem(self, rhs: DurationInSeconds) -> Option<Self>
fn rem(self, rhs: DurationInSeconds) -> Option<Self>
Performs the
%
operation. Read moresourceimpl Sub<DurationInSeconds> for PositionInSeconds
impl Sub<DurationInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
-
operator.sourcefn sub(self, rhs: DurationInSeconds) -> Self
fn sub(self, rhs: DurationInSeconds) -> Self
Performs the
-
operation. Read moresourceimpl Sub<PositionInSeconds> for PositionInSeconds
impl Sub<PositionInSeconds> for PositionInSeconds
type Output = PositionInSeconds
type Output = PositionInSeconds
The resulting type after applying the
-
operator.sourceimpl Sub<f64> for PositionInSeconds
impl Sub<f64> for PositionInSeconds
sourceimpl TryFrom<PositionInSeconds> for DurationInSeconds
impl TryFrom<PositionInSeconds> for DurationInSeconds
type Error = TryFromGreaterError<f64>
type Error = TryFromGreaterError<f64>
The type returned in the event of a conversion error.
sourcefn try_from(value: PositionInSeconds) -> Result<Self, Self::Error>
fn try_from(value: PositionInSeconds) -> Result<Self, Self::Error>
Performs the conversion.
sourceimpl TryFrom<f64> for PositionInSeconds
impl TryFrom<f64> for PositionInSeconds
impl Copy for PositionInSeconds
impl Eq for PositionInSeconds
impl StructuralPartialEq for PositionInSeconds
Auto Trait Implementations
impl RefUnwindSafe for PositionInSeconds
impl Send for PositionInSeconds
impl Sync for PositionInSeconds
impl Unpin for PositionInSeconds
impl UnwindSafe for PositionInSeconds
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
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
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more