pub trait Scale<T> {
// Required method
fn tick(&self, value: &T) -> Option<f32>;
// Provided method
fn nearest_index(&self, _tick: f32) -> usize { ... }
}Required Methods§
Provided Methods§
Sourcefn nearest_index(&self, _tick: f32) -> usize
fn nearest_index(&self, _tick: f32) -> usize
The index of the domain value whose position is nearest tick; 0 for
an empty domain or a scale without discrete positions.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".