Trait Op

Source
pub trait Op {
    // Required methods
    fn op<F: FnOnce(f32, f32) -> f32>(&self, rhs: &Self, op: F) -> Self;
    fn op_to<T, F: FnOnce(f32, f32) -> T>(&self, rhs: &Self, op: F) -> T;
}
Expand description

A trait for values that support binary operations.

Required Methods§

Source

fn op<F: FnOnce(f32, f32) -> f32>(&self, rhs: &Self, op: F) -> Self

Returns the result of the operation in the same type.

Source

fn op_to<T, F: FnOnce(f32, f32) -> T>(&self, rhs: &Self, op: F) -> T

Returns the result of the operation in a different type.

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.

Implementors§