pub trait TryOp: Sized {
// Required methods
fn try_op<F: FnOnce(f32, f32) -> f32>(
&self,
rhs: &Self,
op: F,
) -> Option<Self>;
fn try_op_to<T, F: FnOnce(f32, f32) -> T>(
&self,
rhs: &Self,
op: F,
) -> Option<T>;
}Expand description
A trait for values that potentially support a binary operation (e.g. if they have the same unit).
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".