pub trait ValNum {
// Required method
fn val_num_f32(self) -> f32;
}Available on crate feature
bevy_ui only.Expand description
All the types that should be able to be used in the Val enum should implement this trait.
Instead of just implementing Into<Val> a custom trait is added.
This is done in order to prevent having to define a default unit, which could lead to confusion especially for newcomers.
Required Methods§
Sourcefn val_num_f32(self) -> f32
fn val_num_f32(self) -> f32
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".