cushy::widgets::slider

Trait SliderValue

Source
pub trait SliderValue:
    Clone
    + PartialEq
    + Send
    + Debug
    + 'static {
    type Value: Clone + Debug + PartialOrd + LinearInterpolate + PercentBetween + Send + 'static;

    const RANGED: bool;

    // Required methods
    fn into_parts(self) -> (Self::Value, Option<Self::Value>);
    fn from_parts(min_or_value: Self::Value, max: Option<Self::Value>) -> Self;
}
Expand description

A value that can be used in a Slider widget.

Required Associated Constants§

Source

const RANGED: bool

When true, this type is expected to represent two values: start and an end.

Required Associated Types§

Source

type Value: Clone + Debug + PartialOrd + LinearInterpolate + PercentBetween + Send + 'static

The component value for the slider.

Required Methods§

Source

fn into_parts(self) -> (Self::Value, Option<Self::Value>)

Returns this value split into its start and end components.

Source

fn from_parts(min_or_value: Self::Value, max: Option<Self::Value>) -> Self

Constructs a value from its start and end components.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<T> SliderValue for (T, T)

Source§

const RANGED: bool = true

Source§

type Value = T

Source§

fn into_parts(self) -> (Self::Value, Option<Self::Value>)

Source§

fn from_parts(min_or_value: Self::Value, max: Option<Self::Value>) -> Self

Source§

impl<T> SliderValue for RangeInclusive<T>

Source§

const RANGED: bool = true

Source§

type Value = T

Source§

fn into_parts(self) -> (Self::Value, Option<Self::Value>)

Source§

fn from_parts(min_or_value: Self::Value, max: Option<Self::Value>) -> Self

Implementors§

Source§

impl<T> SliderValue for T

Source§

const RANGED: bool = false

Source§

type Value = T