pub struct Pure<F>(pub F);Expand description
Adapter turning a raw closure Fn(f64) -> T into an Eval segment.
A closure is an anonymous type, so it cannot implement Eval by name; this
named wrapper is the lightweight way to write a pure segment from a closure:
ⓘ
let animation = Pure::new(|alpha| Square::new(alpha)).with_duration(2.0);Named pure animations implement Eval directly and do not need this
wrapper.
Tuple Fields§
§0: FImplementations§
Trait Implementations§
Auto Trait Implementations§
impl<F> Freeze for Pure<F>where
F: Freeze,
impl<F> RefUnwindSafe for Pure<F>where
F: RefUnwindSafe,
impl<F> Send for Pure<F>where
F: Send,
impl<F> Sync for Pure<F>where
F: Sync,
impl<F> Unpin for Pure<F>where
F: Unpin,
impl<F> UnsafeUnpin for Pure<F>where
F: UnsafeUnpin,
impl<F> UnwindSafe for Pure<F>where
F: 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
Mutably borrows from an owned value. Read more
impl<T> ConditionalSend for Twhere
T: Send,
Source§impl<E> EvalExt for Ewhere
E: Eval,
impl<E> EvalExt for Ewhere
E: Eval,
Source§fn apply_alpha_to(self, item: &mut Self::Output, alpha: f64) -> Self
fn apply_alpha_to(self, item: &mut Self::Output, alpha: f64) -> Self
Write the state at progress
alpha into item and return this
evaluator (defined through eval_alpha).Source§fn apply_to(self, item: &mut Self::Output) -> Self
fn apply_to(self, item: &mut Self::Output) -> Self
Write the end state (
alpha == 1.0) into item and return this
evaluator (defined through EvalExt::apply_alpha_to).§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<E> IntoAnimNode for E
impl<E> IntoAnimNode for E
Source§fn into_anim_node(self) -> AnimNode
fn into_anim_node(self) -> AnimNode
Lower this definition into its local runtime representation.
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 more§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
Converts this type into the system output type.
§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<A> PlaybackExt for Awhere
A: Unplaced,
impl<A> PlaybackExt for Awhere
A: Unplaced,
Source§fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
fn with_rate_func(self, rate_func: fn(f64) -> f64) -> Paramed<Self>
Change the animation’s rate function.
Source§fn with_duration(self, duration_secs: f64) -> Paramed<Self>
fn with_duration(self, duration_secs: f64) -> Paramed<Self>
Change the animation’s duration.
Source§fn with_enabled(self, enabled: bool) -> Paramed<Self>
fn with_enabled(self, enabled: bool) -> Paramed<Self>
Enable or disable this animation’s output.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> TransformedExt for T
impl<T> TransformedExt for T
Source§fn transformed<G>(self, transform: G) -> Transformed<Self, G>
fn transformed<G>(self, transform: G) -> Transformed<Self, G>
Return
self wrapped with transform stored exactly as G.