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§
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>
Provided Methods§
fn on_target_changed(&self, _state: &mut Self::State)
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.