pub enum InterpolationDatum<T> {
Exact(T),
LeftTail(T),
RightTail(T),
Between(T, T, f32),
}Expand description
This type expresses the relationship of a value to a fixed collection of values. It is a kind of summary used intermediately by sampling operations.
Variants§
Exact(T)
This value lies exactly on a value in the family.
LeftTail(T)
This value is off the left tail of the family; the inner value is the family’s leftmost.
RightTail(T)
This value is off the right tail of the family; the inner value is the family’s rightmost.
Between(T, T, f32)
This value lies on the interior, in between two points, with a third parameter expressing the interpolation factor between the two.
Implementations§
Source§impl<T> InterpolationDatum<T>
impl<T> InterpolationDatum<T>
Sourcepub fn map<S>(self, f: impl Fn(T) -> S) -> InterpolationDatum<S>
pub fn map<S>(self, f: impl Fn(T) -> S) -> InterpolationDatum<S>
Map all values using a given function f, leaving the interpolation parameters in any
Between variants unchanged.
Trait Implementations§
Source§impl<T: Clone> Clone for InterpolationDatum<T>
impl<T: Clone> Clone for InterpolationDatum<T>
Source§fn clone(&self) -> InterpolationDatum<T>
fn clone(&self) -> InterpolationDatum<T>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<T: Copy> Copy for InterpolationDatum<T>
Source§impl<T: Debug> Debug for InterpolationDatum<T>
impl<T: Debug> Debug for InterpolationDatum<T>
Source§impl<'de, T> Deserialize<'de> for InterpolationDatum<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for InterpolationDatum<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: PartialEq> PartialEq for InterpolationDatum<T>
impl<T: PartialEq> PartialEq for InterpolationDatum<T>
Source§impl<T> Serialize for InterpolationDatum<T>where
T: Serialize,
impl<T> Serialize for InterpolationDatum<T>where
T: Serialize,
impl<T: PartialEq> StructuralPartialEq for InterpolationDatum<T>
Auto Trait Implementations§
impl<T> Freeze for InterpolationDatum<T>where
T: Freeze,
impl<T> RefUnwindSafe for InterpolationDatum<T>where
T: RefUnwindSafe,
impl<T> Send for InterpolationDatum<T>where
T: Send,
impl<T> Sync for InterpolationDatum<T>where
T: Sync,
impl<T> Unpin for InterpolationDatum<T>where
T: Unpin,
impl<T> UnsafeUnpin for InterpolationDatum<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for InterpolationDatum<T>where
T: 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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 moreSource§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T> TypeData for T
impl<T> TypeData for T
Source§fn clone_type_data(&self) -> Box<dyn TypeData>
fn clone_type_data(&self) -> Box<dyn TypeData>
Creates a type-erased clone of
self.