Struct pareen::AnimWithDur

source ·
pub struct AnimWithDur<F: Fun>(pub Anim<F>, pub F::T);
Expand description

An Anim together with the duration that it is intended to be played for.

Explicitly carrying the duration around makes it easier to sequentially compose animations in some places.

Tuple Fields§

§0: Anim<F>§1: F::T

Implementations§

source§

impl<F> AnimWithDur<F>where F: Fun, F::T: Clone,

source

pub fn as_ref(&self) -> AnimWithDur<&F>

source§

impl<F> AnimWithDur<F>where F: Fun,

source

pub fn transform<G, H>(self, h: H) -> AnimWithDur<G>where G: Fun<T = F::T>, H: FnOnce(Anim<F>) -> Anim<G>,

source

pub fn map<W>( self, f: impl Fn(F::V) -> W ) -> AnimWithDur<impl Fun<T = F::T, V = W>>

source

pub fn dur(self, t: F::T) -> AnimWithDur<F>

source§

impl<'a, T, X, Y, F> AnimWithDur<F>where T: 'a + Clone, X: 'a, Y: 'a, F: Fun<T = T, V = (X, Y)>,

source

pub fn unzip( &'a self ) -> (AnimWithDur<impl Fun<T = F::T, V = X> + 'a>, AnimWithDur<impl Fun<T = F::T, V = Y> + 'a>)

source§

impl<F> AnimWithDur<F>where F: Fun, F::T: Copy + PartialOrd + Sub<Output = F::T>,

source

pub fn seq<G>(self, next: Anim<G>) -> Anim<impl Fun<T = F::T, V = F::V>>where G: Fun<T = F::T, V = F::V>,

source§

impl<F> AnimWithDur<F>where F: Fun, F::T: Copy + PartialOrd + Sub<Output = F::T> + Add<Output = F::T>,

source

pub fn seq_with_dur<G>( self, next: AnimWithDur<G> ) -> AnimWithDur<impl Fun<T = F::T, V = F::V>>where G: Fun<T = F::T, V = F::V>,

source§

impl<F> AnimWithDur<F>where F: Fun, F::T: Clone + FloatCore,

source

pub fn repeat(self) -> Anim<impl Fun<T = F::T, V = F::V>>

source§

impl<F> AnimWithDur<F>where F: Fun, F::T: Clone + Sub<Output = F::T>,

source

pub fn backwards(self) -> AnimWithDur<impl Fun<T = F::T, V = F::V>>

source§

impl<F> AnimWithDur<F>where F: Fun, F::T: Clone + Mul<Output = F::T> + Div<Output = F::T>,

source

pub fn scale_time( self, t_scale: F::T ) -> AnimWithDur<impl Fun<T = F::T, V = F::V>>

source§

impl<F> AnimWithDur<F>where F: Fun<T = usize>,

source

pub fn fold<B, G>(&self, init: B, f: G) -> Bwhere G: FnMut(B, F::V) -> B,

source§

impl<F> AnimWithDur<F>where F: Fun<T = usize>, F::V: Add<Output = F::V> + Zero,

source

pub fn sum(&self) -> F::V

source§

impl<F> AnimWithDur<F>where F: Fun<T = usize>, F::T: Clone, F::V: 'static + Add<Output = F::V> + Div<Output = F::V> + Zero + Copy, usize: AsPrimitive<F::V>,

source

pub fn mean(&self) -> F::V

Trait Implementations§

source§

impl<F: Clone + Fun> Clone for AnimWithDur<F>where F::T: Clone,

source§

fn clone(&self) -> AnimWithDur<F>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<F: Debug + Fun> Debug for AnimWithDur<F>where F::T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<F> RefUnwindSafe for AnimWithDur<F>where F: RefUnwindSafe, <F as Fun>::T: RefUnwindSafe,

§

impl<F> Send for AnimWithDur<F>where F: Send, <F as Fun>::T: Send,

§

impl<F> Sync for AnimWithDur<F>where F: Sync, <F as Fun>::T: Sync,

§

impl<F> Unpin for AnimWithDur<F>where F: Unpin, <F as Fun>::T: Unpin,

§

impl<F> UnwindSafe for AnimWithDur<F>where F: UnwindSafe, <F as Fun>::T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.