pub trait ScatterScalar:
Sealed
+ Copy
+ Send
+ Sync {
// Required method
fn wrapping_add(self, rhs: Self) -> Self;
}Expand description
Element types accepted by ScatterPlan::execute.
The trait is sealed: it is implemented for f32, f64, i32, i64,
Complex32 and Complex64 (the dtypes the erased scatter entry
dispatches) and cannot be implemented outside this crate. Its one method
is the accumulating combine of additive scatter, so the typed and
dtype-erased entries share the same element arithmetic.
Required Methods§
Sourcefn wrapping_add(self, rhs: Self) -> Self
fn wrapping_add(self, rhs: Self) -> Self
The additive-scatter combine, self + rhs.
Integer types wrap on overflow in every build profile
(i32::wrapping_add, i64::wrapping_add); floating-point and complex
types use IEEE addition, which has no overflow panic.
§Examples
use strided_basic::ScatterScalar;
assert_eq!(ScatterScalar::wrapping_add(i32::MAX, 1), i32::MIN);
assert_eq!(ScatterScalar::wrapping_add(1.5_f64, 2.0), 3.5);Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".