pub struct AddOp;Expand description
Ordinary CPU entry points that take a caller-provided destination and the caller’s own arithmetic instead of the typed pool. Addition.
§Examples
use tenferro_internal_cpu_kernels::scalar_ops::{AddOp, BinaryScalarOp};
assert_eq!(<AddOp as BinaryScalarOp<i32>>::apply(1, 2), 3);Trait Implementations§
Source§impl<T> BinaryScalarOp<T> for AddOpwhere
T: ScalarArithmetic,
impl<T> BinaryScalarOp<T> for AddOpwhere
T: ScalarArithmetic,
Source§fn apply(lhs: T, rhs: T) -> T
fn apply(lhs: T, rhs: T) -> T
The scalar contract’s addition, which wraps for the integer members.
Going through the contract rather than the operator matters for integers: the operator
panics on overflow in a debug build and wraps in a release build, while the contract
wraps in both, which is what the preset path and ScalarArithmetic::scalar_add promise.
Auto Trait Implementations§
impl Freeze for AddOp
impl RefUnwindSafe for AddOp
impl Send for AddOp
impl Sync for AddOp
impl Unpin for AddOp
impl UnsafeUnpin for AddOp
impl UnwindSafe for AddOp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> Imply<T> for U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more