Struct vek::transition::Transition [−][src]
pub struct Transition<T, F, Progress = f32> { pub start: T, pub end: T, pub progress: Progress, pub progress_mapper: F, }
Expand description
A convenience structure for storing a progression from one value to another.
Fields
start: T
Expand description
The value when progress gets close to 0.
end: T
Expand description
The value when progress gets close to 1.
progress: Progress
Expand description
Expected to be between 0 and 1.
progress_mapper: F
Expand description
Functor that maps the current progress value to a LERP factor.
Implementations
impl<T, F, Progress> Transition<T, F, Progress>
[src]
impl<T, F, Progress> Transition<T, F, Progress>
[src]pub fn with_mapper(start: T, end: T, progress_mapper: F) -> Self where
Progress: Zero,
[src]
pub fn with_mapper(start: T, end: T, progress_mapper: F) -> Self where
Progress: Zero,
[src]Creates a new Transition
from start
and end
values and progress_mapper
, setting progress
to zero.
pub fn with_mapper_and_progress(
start: T,
end: T,
progress_mapper: F,
progress: Progress
) -> Self
[src]
pub fn with_mapper_and_progress(
start: T,
end: T,
progress_mapper: F,
progress: Progress
) -> Self
[src]Creates a new Transition
from start
, end
, progress_mapper
and progress
values.
pub fn into_range(self) -> Range<T>
[src]
pub fn into_range(self) -> Range<T>
[src]Converts this into a Range
, dropping the progress
and progress_mapper
values.
impl<T, F, Progress> Transition<T, F, Progress> where
F: ProgressMapper<Progress>,
[src]
impl<T, F, Progress> Transition<T, F, Progress> where
F: ProgressMapper<Progress>,
[src]pub fn into_current(self) -> T where
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
[src]
pub fn into_current(self) -> T where
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
[src]Gets the transition’s current state, clamping progress to [0;1].
pub fn into_current_unclamped(self) -> T where
T: Lerp<Progress, Output = T>,
[src]
pub fn into_current_unclamped(self) -> T where
T: Lerp<Progress, Output = T>,
[src]Gets the transition’s current state using the progress
value as-is.
pub fn into_current_precise(self) -> T where
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
[src]
pub fn into_current_precise(self) -> T where
T: Lerp<Progress, Output = T>,
Progress: Clamp + Zero + One,
[src]Gets the transition’s current state, clamping progress to [0;1].
pub fn into_current_unclamped_precise(self) -> T where
T: Lerp<Progress, Output = T>,
[src]
pub fn into_current_unclamped_precise(self) -> T where
T: Lerp<Progress, Output = T>,
[src]Gets the transition’s current state using the progress
value as-is.
pub fn current<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
[src]
pub fn current<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
[src]Gets the transition’s current state, clamping progress to [0;1].
pub fn current_unclamped<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
[src]
pub fn current_unclamped<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
[src]Gets the transition’s current state using the progress
value as-is.
pub fn current_precise<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
[src]
pub fn current_precise<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy + Clamp + Zero + One,
[src]Gets the transition’s current state, clamping progress to [0;1].
pub fn current_unclamped_precise<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
[src]
pub fn current_unclamped_precise<'a>(&'a self) -> T where
&'a T: Lerp<Progress, Output = T>,
Progress: Copy,
[src]Gets the transition’s current state using the progress
value as-is.
impl<T, Progress> Transition<T, IdentityProgressMapper, Progress>
[src]
impl<T, Progress> Transition<T, IdentityProgressMapper, Progress>
[src]pub fn new(start: T, end: T) -> Self where
Progress: Zero,
[src]
pub fn new(start: T, end: T) -> Self where
Progress: Zero,
[src]Creates a new LinearTransition
from start
and end
values, setting progress
to zero.
pub fn with_progress(start: T, end: T, progress: Progress) -> Self
[src]
pub fn with_progress(start: T, end: T, progress: Progress) -> Self
[src]Creates a new LinearTransition
from start
, end
and progress
values.
Trait Implementations
impl<T: Clone, F: Clone, Progress: Clone> Clone for Transition<T, F, Progress>
[src]
impl<T: Clone, F: Clone, Progress: Clone> Clone for Transition<T, F, Progress>
[src]fn clone(&self) -> Transition<T, F, Progress>
[src]
fn clone(&self) -> Transition<T, F, Progress>
[src]Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]Performs copy-assignment from source
. Read more
impl<'de, T, F, Progress> Deserialize<'de> for Transition<T, F, Progress> where
T: Deserialize<'de>,
F: Deserialize<'de>,
Progress: Deserialize<'de>,
[src]
impl<'de, T, F, Progress> Deserialize<'de> for Transition<T, F, Progress> where
T: Deserialize<'de>,
F: Deserialize<'de>,
Progress: Deserialize<'de>,
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl<T: PartialEq, F: PartialEq, Progress: PartialEq> PartialEq<Transition<T, F, Progress>> for Transition<T, F, Progress>
[src]
impl<T: PartialEq, F: PartialEq, Progress: PartialEq> PartialEq<Transition<T, F, Progress>> for Transition<T, F, Progress>
[src]fn eq(&self, other: &Transition<T, F, Progress>) -> bool
[src]
fn eq(&self, other: &Transition<T, F, Progress>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &Transition<T, F, Progress>) -> bool
[src]
fn ne(&self, other: &Transition<T, F, Progress>) -> bool
[src]This method tests for !=
.
impl<T, F, Progress> Serialize for Transition<T, F, Progress> where
T: Serialize,
F: Serialize,
Progress: Serialize,
[src]
impl<T, F, Progress> Serialize for Transition<T, F, Progress> where
T: Serialize,
F: Serialize,
Progress: Serialize,
[src]impl<T: Copy, F: Copy, Progress: Copy> Copy for Transition<T, F, Progress>
[src]
impl<T: Eq, F: Eq, Progress: Eq> Eq for Transition<T, F, Progress>
[src]
impl<T, F, Progress> StructuralEq for Transition<T, F, Progress>
[src]
impl<T, F, Progress> StructuralPartialEq for Transition<T, F, Progress>
[src]
Auto Trait Implementations
impl<T, F, Progress> RefUnwindSafe for Transition<T, F, Progress> where
F: RefUnwindSafe,
Progress: RefUnwindSafe,
T: RefUnwindSafe,
F: RefUnwindSafe,
Progress: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, F, Progress> Send for Transition<T, F, Progress> where
F: Send,
Progress: Send,
T: Send,
F: Send,
Progress: Send,
T: Send,
impl<T, F, Progress> Sync for Transition<T, F, Progress> where
F: Sync,
Progress: Sync,
T: Sync,
F: Sync,
Progress: Sync,
T: Sync,
impl<T, F, Progress> Unpin for Transition<T, F, Progress> where
F: Unpin,
Progress: Unpin,
T: Unpin,
F: Unpin,
Progress: Unpin,
T: Unpin,
impl<T, F, Progress> UnwindSafe for Transition<T, F, Progress> where
F: UnwindSafe,
Progress: UnwindSafe,
T: UnwindSafe,
F: UnwindSafe,
Progress: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,