Trait cushy::widgets::slider::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 Types§

source

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

The component value for the slider.

Required Associated Constants§

source

const RANGED: bool

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

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.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl<T> SliderValue for (T, T)

§

type Value = T

source§

const RANGED: bool = true

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>

§

type Value = T

source§

const RANGED: bool = true

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

§

type Value = T

source§

const RANGED: bool = false