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) -> bool { ... }
}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)
Sourcefn update(&self, _state: &mut Self::State, _input_state: InputState) -> bool
fn update(&self, _state: &mut Self::State, _input_state: InputState) -> bool
Advances the animation by a single frame.
Returns whether the appearance of the indicator changed, i.e. whether the menu needs to be redrawn. Styles that animate should only report the frames on which what they render actually differs from the previous frame.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".