Trait IndicatorStyle

Source
pub trait IndicatorStyle: Copy {
    type Shape: ContainsPoint + Transform + Clone;
    type State: Default + Copy;

    // Required methods
    fn padding(&self, state: &Self::State, height: i32) -> Insets;
    fn shape(
        &self,
        state: &Self::State,
        bounds: Rectangle,
        fill_width: u32,
    ) -> Self::Shape;
    fn draw<T, D>(
        &self,
        state: &Self::State,
        input_state: InputState,
        theme: &T,
        display: &mut D,
    ) -> Result<Self::Shape, D::Error>
       where T: Theme,
             D: DrawTarget<Color = T::Color>;

    // Provided methods
    fn on_target_changed(&self, _state: &mut Self::State) { ... }
    fn update(&self, _state: &mut Self::State, _input_state: InputState) { ... }
}

Required Associated Types§

Required Methods§

Source

fn padding(&self, state: &Self::State, height: i32) -> Insets

Source

fn shape( &self, state: &Self::State, bounds: Rectangle, fill_width: u32, ) -> Self::Shape

Source

fn draw<T, D>( &self, state: &Self::State, input_state: InputState, theme: &T, display: &mut D, ) -> Result<Self::Shape, D::Error>
where T: Theme, D: DrawTarget<Color = T::Color>,

Provided Methods§

Source

fn on_target_changed(&self, _state: &mut Self::State)

Source

fn update(&self, _state: &mut Self::State, _input_state: InputState)

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.

Implementors§