Skip to main content

Spring

Struct Spring 

Source
pub struct Spring<T, I, M = Once>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity),
{ /* private fields */ }

Implementations§

Source§

impl<T, I, M> Spring<T, I, M>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity),

Source

pub fn new(initial: T, params: SpringParams, interp: I) -> Self

Source

pub fn velocity(&self) -> f64
where T::Velocity: Settled,

Trait Implementations§

Source§

impl<T, I, M> AddAssign<T> for Spring<T, I, M>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity), for<'b> &'b T: Add<T, Output = T>, Self: Animate<Value = T>,

Source§

fn add_assign(&mut self, rhs: T)

Performs the += operation. Read more
Source§

impl<T, I> Animate for Spring<T, I, Once>
where T: SpringAnim + PartialEq + Distance, T::Velocity: Settled, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity),

Source§

type Value = T

Source§

fn update(&mut self)

Source§

fn get(&self) -> &T

Source§

fn set(&mut self, target: T)

Source§

fn target(&self) -> &T

Source§

impl<T, I> Animate for Spring<T, I, Alternate>
where T: SpringAnim + PartialEq + Distance, T::Velocity: Settled, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity),

Source§

type Value = T

Source§

fn update(&mut self)

Source§

fn get(&self) -> &T

Source§

fn set(&mut self, target: T)

Source§

fn target(&self) -> &T

Source§

impl<T, I> Animate for Spring<T, I, Cycle>
where T: SpringAnim + PartialEq + Distance, T::Velocity: Settled, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity),

Source§

type Value = T

Source§

fn update(&mut self)

Source§

fn get(&self) -> &T

Source§

fn set(&mut self, target: T)

Source§

fn target(&self) -> &T

Source§

impl<T, I, M> Deref for Spring<T, I, M>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity), Self: Animate<Value = T>,

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<T, I, M> Display for Spring<T, I, M>
where M: Mode, T: SpringAnim + Display, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity), Self: Animate<Value = T>,

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<T, I, M> DivAssign<T> for Spring<T, I, M>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity), for<'b> &'b T: Div<T, Output = T>, Self: Animate<Value = T>,

Source§

fn div_assign(&mut self, rhs: T)

Performs the /= operation. Read more
Source§

impl<T, I, M> MulAssign<T> for Spring<T, I, M>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity), for<'b> &'b T: Mul<T, Output = T>, Self: Animate<Value = T>,

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T, I, M> SubAssign<T> for Spring<T, I, M>
where M: Mode, T: SpringAnim, I: Fn(&T, &T, &T::Velocity, SpringParams, f64) -> (T, T::Velocity), for<'b> &'b T: Sub<T, Output = T>, Self: Animate<Value = T>,

Source§

fn sub_assign(&mut self, rhs: T)

Performs the -= operation. Read more

Auto Trait Implementations§

§

impl<T, I, M> Freeze for Spring<T, I, M>
where T: Freeze, <T as SpringAnim>::Velocity: Freeze, I: Freeze,

§

impl<T, I, M> RefUnwindSafe for Spring<T, I, M>

§

impl<T, I, M> Send for Spring<T, I, M>
where T: Send, <T as SpringAnim>::Velocity: Send, I: Send, M: Send,

§

impl<T, I, M> Sync for Spring<T, I, M>
where T: Sync, <T as SpringAnim>::Velocity: Sync, I: Sync, M: Sync,

§

impl<T, I, M> Unpin for Spring<T, I, M>
where T: Unpin, <T as SpringAnim>::Velocity: Unpin, I: Unpin, M: Unpin,

§

impl<T, I, M> UnsafeUnpin for Spring<T, I, M>

§

impl<T, I, M> UnwindSafe for Spring<T, I, M>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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.