Trait slot_range_helper::Add
1.0.0 · source · pub trait Add<Rhs = Self> {
type Output;
// Required method
fn add(self, rhs: Rhs) -> Self::Output;
}
Expand description
The addition operator +
.
Note that Rhs
is Self
by default, but this is not mandatory. For
example, std::time::SystemTime
implements Add<Duration>
, which permits
operations of the form SystemTime = SystemTime + Duration
.
Examples
Add
able points
use std::ops::Add;
#[derive(Debug, Copy, Clone, PartialEq)]
struct Point {
x: i32,
y: i32,
}
impl Add for Point {
type Output = Self;
fn add(self, other: Self) -> Self {
Self {
x: self.x + other.x,
y: self.y + other.y,
}
}
}
assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 },
Point { x: 3, y: 3 });
Implementing Add
with generics
Here is an example of the same Point
struct implementing the Add
trait
using generics.
use std::ops::Add;
#[derive(Debug, Copy, Clone, PartialEq)]
struct Point<T> {
x: T,
y: T,
}
// Notice that the implementation uses the associated type `Output`.
impl<T: Add<Output = T>> Add for Point<T> {
type Output = Self;
fn add(self, other: Self) -> Self::Output {
Self {
x: self.x + other.x,
y: self.y + other.y,
}
}
}
assert_eq!(Point { x: 1, y: 0 } + Point { x: 2, y: 3 },
Point { x: 3, y: 3 });
Required Associated Types§
Required Methods§
Implementors§
source§impl Add<&str> for String
impl Add<&str> for String
Implements the +
operator for concatenating two strings.
This consumes the String
on the left-hand side and re-uses its buffer (growing it if
necessary). This is done to avoid allocating a new String
and copying the entire contents on
every operation, which would lead to O(n^2) running time when building an n-byte string by
repeated concatenation.
The string on the right-hand side is only borrowed; its contents are copied into the returned
String
.
Examples
Concatenating two String
s takes the first by value and borrows the second:
let a = String::from("hello");
let b = String::from(" world");
let c = a + &b;
// `a` is moved and can no longer be used here.
If you want to keep using the first String
, you can clone it and append to the clone instead:
let a = String::from("hello");
let b = String::from(" world");
let c = a.clone() + &b;
// `a` is still valid here.
Concatenating &str
slices can be done by converting the first to a String
:
let a = "hello";
let b = " world";
let c = a.to_string() + b;
source§impl Add<&Saturating<i8>> for &Saturating<i8>
impl Add<&Saturating<i8>> for &Saturating<i8>
type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output
source§impl Add<&Saturating<i8>> for Saturating<i8>
impl Add<&Saturating<i8>> for Saturating<i8>
type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output
source§impl Add<&Saturating<i16>> for &Saturating<i16>
impl Add<&Saturating<i16>> for &Saturating<i16>
type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output
source§impl Add<&Saturating<i16>> for Saturating<i16>
impl Add<&Saturating<i16>> for Saturating<i16>
type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output
source§impl Add<&Saturating<i32>> for &Saturating<i32>
impl Add<&Saturating<i32>> for &Saturating<i32>
type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output
source§impl Add<&Saturating<i32>> for Saturating<i32>
impl Add<&Saturating<i32>> for Saturating<i32>
type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output
source§impl Add<&Saturating<i64>> for &Saturating<i64>
impl Add<&Saturating<i64>> for &Saturating<i64>
type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output
source§impl Add<&Saturating<i64>> for Saturating<i64>
impl Add<&Saturating<i64>> for Saturating<i64>
type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output
source§impl Add<&Saturating<i128>> for &Saturating<i128>
impl Add<&Saturating<i128>> for &Saturating<i128>
type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output
source§impl Add<&Saturating<i128>> for Saturating<i128>
impl Add<&Saturating<i128>> for Saturating<i128>
type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output
source§impl Add<&Saturating<isize>> for &Saturating<isize>
impl Add<&Saturating<isize>> for &Saturating<isize>
type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output
source§impl Add<&Saturating<isize>> for Saturating<isize>
impl Add<&Saturating<isize>> for Saturating<isize>
type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output
source§impl Add<&Saturating<u8>> for &Saturating<u8>
impl Add<&Saturating<u8>> for &Saturating<u8>
type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output
source§impl Add<&Saturating<u8>> for Saturating<u8>
impl Add<&Saturating<u8>> for Saturating<u8>
type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output
source§impl Add<&Saturating<u16>> for &Saturating<u16>
impl Add<&Saturating<u16>> for &Saturating<u16>
type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output
source§impl Add<&Saturating<u16>> for Saturating<u16>
impl Add<&Saturating<u16>> for Saturating<u16>
type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output
source§impl Add<&Saturating<u32>> for &Saturating<u32>
impl Add<&Saturating<u32>> for &Saturating<u32>
type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output
source§impl Add<&Saturating<u32>> for Saturating<u32>
impl Add<&Saturating<u32>> for Saturating<u32>
type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output
source§impl Add<&Saturating<u64>> for &Saturating<u64>
impl Add<&Saturating<u64>> for &Saturating<u64>
type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output
source§impl Add<&Saturating<u64>> for Saturating<u64>
impl Add<&Saturating<u64>> for Saturating<u64>
type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output
source§impl Add<&Saturating<u128>> for &Saturating<u128>
impl Add<&Saturating<u128>> for &Saturating<u128>
type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output
source§impl Add<&Saturating<u128>> for Saturating<u128>
impl Add<&Saturating<u128>> for Saturating<u128>
type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output
source§impl Add<&Saturating<usize>> for &Saturating<usize>
impl Add<&Saturating<usize>> for &Saturating<usize>
type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output
source§impl Add<&Saturating<usize>> for Saturating<usize>
impl Add<&Saturating<usize>> for Saturating<usize>
type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output
source§impl Add<Months> for NaiveDateTime
impl Add<Months> for NaiveDateTime
type Output = NaiveDateTime
source§impl Add<Days> for NaiveDateTime
impl Add<Days> for NaiveDateTime
type Output = NaiveDateTime
source§impl Add<FixedOffset> for NaiveDateTime
impl Add<FixedOffset> for NaiveDateTime
type Output = NaiveDateTime
source§impl Add<EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
impl Add<EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl Add<EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
impl Add<EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl Add<RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
impl Add<RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl Add<RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
impl Add<RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl Add<u32x4_generic> for u32x4_generic
impl Add<u32x4_generic> for u32x4_generic
type Output = u32x4_generic
source§impl Add<u64x2_generic> for u64x2_generic
impl Add<u64x2_generic> for u64x2_generic
type Output = u64x2_generic
source§impl Add<u128x1_generic> for u128x1_generic
impl Add<u128x1_generic> for u128x1_generic
type Output = u128x1_generic
source§impl Add<Perquintill> for Perquintill
impl Add<Perquintill> for Perquintill
type Output = Perquintill
source§impl Add<Duration> for NaiveDate
impl Add<Duration> for NaiveDate
An addition of Duration
to NaiveDate
discards the fractional days,
rounding to the closest integral number of days towards Duration::zero()
.
Panics on underflow or overflow.
Use NaiveDate::checked_add_signed
to detect that.
Example
use chrono::{Duration, NaiveDate};
let from_ymd = NaiveDate::from_ymd;
assert_eq!(from_ymd(2014, 1, 1) + Duration::zero(), from_ymd(2014, 1, 1));
assert_eq!(from_ymd(2014, 1, 1) + Duration::seconds(86399), from_ymd(2014, 1, 1));
assert_eq!(from_ymd(2014, 1, 1) + Duration::seconds(-86399), from_ymd(2014, 1, 1));
assert_eq!(from_ymd(2014, 1, 1) + Duration::days(1), from_ymd(2014, 1, 2));
assert_eq!(from_ymd(2014, 1, 1) + Duration::days(-1), from_ymd(2013, 12, 31));
assert_eq!(from_ymd(2014, 1, 1) + Duration::days(364), from_ymd(2014, 12, 31));
assert_eq!(from_ymd(2014, 1, 1) + Duration::days(365*4 + 1), from_ymd(2018, 1, 1));
assert_eq!(from_ymd(2014, 1, 1) + Duration::days(365*400 + 97), from_ymd(2414, 1, 1));
source§impl Add<Duration> for NaiveDateTime
impl Add<Duration> for NaiveDateTime
An addition of Duration
to NaiveDateTime
yields another NaiveDateTime
.
As a part of Chrono’s leap second handling,
the addition assumes that there is no leap second ever,
except when the NaiveDateTime
itself represents a leap second
in which case the assumption becomes that there is exactly a single leap second ever.
Panics on underflow or overflow. Use NaiveDateTime::checked_add_signed
to detect that.
Example
use chrono::{Duration, NaiveDate};
let from_ymd = NaiveDate::from_ymd;
let d = from_ymd(2016, 7, 8);
let hms = |h, m, s| d.and_hms_opt(h, m, s).unwrap();
assert_eq!(hms(3, 5, 7) + Duration::zero(), hms(3, 5, 7));
assert_eq!(hms(3, 5, 7) + Duration::seconds(1), hms(3, 5, 8));
assert_eq!(hms(3, 5, 7) + Duration::seconds(-1), hms(3, 5, 6));
assert_eq!(hms(3, 5, 7) + Duration::seconds(3600 + 60), hms(4, 6, 7));
assert_eq!(hms(3, 5, 7) + Duration::seconds(86_400),
from_ymd(2016, 7, 9).and_hms_opt(3, 5, 7).unwrap());
assert_eq!(hms(3, 5, 7) + Duration::days(365),
from_ymd(2017, 7, 8).and_hms_opt(3, 5, 7).unwrap());
let hmsm = |h, m, s, milli| d.and_hms_milli_opt(h, m, s, milli).unwrap();
assert_eq!(hmsm(3, 5, 7, 980) + Duration::milliseconds(450), hmsm(3, 5, 8, 430));
Leap seconds are handled, but the addition assumes that it is the only leap second happened.
let leap = hmsm(3, 5, 59, 1_300);
assert_eq!(leap + Duration::zero(), hmsm(3, 5, 59, 1_300));
assert_eq!(leap + Duration::milliseconds(-500), hmsm(3, 5, 59, 800));
assert_eq!(leap + Duration::milliseconds(500), hmsm(3, 5, 59, 1_800));
assert_eq!(leap + Duration::milliseconds(800), hmsm(3, 6, 0, 100));
assert_eq!(leap + Duration::seconds(10), hmsm(3, 6, 9, 300));
assert_eq!(leap + Duration::seconds(-10), hmsm(3, 5, 50, 300));
assert_eq!(leap + Duration::days(1),
from_ymd(2016, 7, 9).and_hms_milli_opt(3, 5, 59, 300).unwrap());
type Output = NaiveDateTime
source§impl Add<Duration> for NaiveTime
impl Add<Duration> for NaiveTime
An addition of Duration
to NaiveTime
wraps around and never overflows or underflows.
In particular the addition ignores integral number of days.
As a part of Chrono’s leap second handling,
the addition assumes that there is no leap second ever,
except when the NaiveTime
itself represents a leap second
in which case the assumption becomes that there is exactly a single leap second ever.
Example
use chrono::{Duration, NaiveTime};
let from_hmsm = NaiveTime::from_hms_milli;
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::zero(), from_hmsm(3, 5, 7, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::seconds(1), from_hmsm(3, 5, 8, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::seconds(-1), from_hmsm(3, 5, 6, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::seconds(60 + 4), from_hmsm(3, 6, 11, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::seconds(7*60*60 - 6*60), from_hmsm(9, 59, 7, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::milliseconds(80), from_hmsm(3, 5, 7, 80));
assert_eq!(from_hmsm(3, 5, 7, 950) + Duration::milliseconds(280), from_hmsm(3, 5, 8, 230));
assert_eq!(from_hmsm(3, 5, 7, 950) + Duration::milliseconds(-980), from_hmsm(3, 5, 6, 970));
The addition wraps around.
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::seconds(22*60*60), from_hmsm(1, 5, 7, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::seconds(-8*60*60), from_hmsm(19, 5, 7, 0));
assert_eq!(from_hmsm(3, 5, 7, 0) + Duration::days(800), from_hmsm(3, 5, 7, 0));
Leap seconds are handled, but the addition assumes that it is the only leap second happened.
let leap = from_hmsm(3, 5, 59, 1_300);
assert_eq!(leap + Duration::zero(), from_hmsm(3, 5, 59, 1_300));
assert_eq!(leap + Duration::milliseconds(-500), from_hmsm(3, 5, 59, 800));
assert_eq!(leap + Duration::milliseconds(500), from_hmsm(3, 5, 59, 1_800));
assert_eq!(leap + Duration::milliseconds(800), from_hmsm(3, 6, 0, 100));
assert_eq!(leap + Duration::seconds(10), from_hmsm(3, 6, 9, 300));
assert_eq!(leap + Duration::seconds(-10), from_hmsm(3, 5, 50, 300));
assert_eq!(leap + Duration::days(1), from_hmsm(3, 5, 59, 300));
source§impl Add<Duration> for SteadyTime
impl Add<Duration> for SteadyTime
type Output = SteadyTime
source§impl Add<Saturating<i8>> for Saturating<i8>
impl Add<Saturating<i8>> for Saturating<i8>
type Output = Saturating<i8>
source§impl Add<Saturating<i16>> for Saturating<i16>
impl Add<Saturating<i16>> for Saturating<i16>
type Output = Saturating<i16>
source§impl Add<Saturating<i32>> for Saturating<i32>
impl Add<Saturating<i32>> for Saturating<i32>
type Output = Saturating<i32>
source§impl Add<Saturating<i64>> for Saturating<i64>
impl Add<Saturating<i64>> for Saturating<i64>
type Output = Saturating<i64>
source§impl Add<Saturating<i128>> for Saturating<i128>
impl Add<Saturating<i128>> for Saturating<i128>
type Output = Saturating<i128>
source§impl Add<Saturating<isize>> for Saturating<isize>
impl Add<Saturating<isize>> for Saturating<isize>
type Output = Saturating<isize>
source§impl Add<Saturating<u8>> for Saturating<u8>
impl Add<Saturating<u8>> for Saturating<u8>
type Output = Saturating<u8>
source§impl Add<Saturating<u16>> for Saturating<u16>
impl Add<Saturating<u16>> for Saturating<u16>
type Output = Saturating<u16>
source§impl Add<Saturating<u32>> for Saturating<u32>
impl Add<Saturating<u32>> for Saturating<u32>
type Output = Saturating<u32>
source§impl Add<Saturating<u64>> for Saturating<u64>
impl Add<Saturating<u64>> for Saturating<u64>
type Output = Saturating<u64>
source§impl Add<Saturating<u128>> for Saturating<u128>
impl Add<Saturating<u128>> for Saturating<u128>
type Output = Saturating<u128>
source§impl Add<Saturating<usize>> for Saturating<usize>
impl Add<Saturating<usize>> for Saturating<usize>
type Output = Saturating<usize>
1.8.0 · source§impl Add<Duration> for SystemTime
impl Add<Duration> for SystemTime
type Output = SystemTime
source§impl<'a> Add<EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a> Add<EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl<'a> Add<EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a> Add<EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl<'a> Add<RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
impl<'a> Add<RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl<'a> Add<RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
impl<'a> Add<RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl<'a> Add<Saturating<i8>> for &'a Saturating<i8>
impl<'a> Add<Saturating<i8>> for &'a Saturating<i8>
type Output = <Saturating<i8> as Add<Saturating<i8>>>::Output
source§impl<'a> Add<Saturating<i16>> for &'a Saturating<i16>
impl<'a> Add<Saturating<i16>> for &'a Saturating<i16>
type Output = <Saturating<i16> as Add<Saturating<i16>>>::Output
source§impl<'a> Add<Saturating<i32>> for &'a Saturating<i32>
impl<'a> Add<Saturating<i32>> for &'a Saturating<i32>
type Output = <Saturating<i32> as Add<Saturating<i32>>>::Output
source§impl<'a> Add<Saturating<i64>> for &'a Saturating<i64>
impl<'a> Add<Saturating<i64>> for &'a Saturating<i64>
type Output = <Saturating<i64> as Add<Saturating<i64>>>::Output
source§impl<'a> Add<Saturating<i128>> for &'a Saturating<i128>
impl<'a> Add<Saturating<i128>> for &'a Saturating<i128>
type Output = <Saturating<i128> as Add<Saturating<i128>>>::Output
source§impl<'a> Add<Saturating<isize>> for &'a Saturating<isize>
impl<'a> Add<Saturating<isize>> for &'a Saturating<isize>
type Output = <Saturating<isize> as Add<Saturating<isize>>>::Output
source§impl<'a> Add<Saturating<u8>> for &'a Saturating<u8>
impl<'a> Add<Saturating<u8>> for &'a Saturating<u8>
type Output = <Saturating<u8> as Add<Saturating<u8>>>::Output
source§impl<'a> Add<Saturating<u16>> for &'a Saturating<u16>
impl<'a> Add<Saturating<u16>> for &'a Saturating<u16>
type Output = <Saturating<u16> as Add<Saturating<u16>>>::Output
source§impl<'a> Add<Saturating<u32>> for &'a Saturating<u32>
impl<'a> Add<Saturating<u32>> for &'a Saturating<u32>
type Output = <Saturating<u32> as Add<Saturating<u32>>>::Output
source§impl<'a> Add<Saturating<u64>> for &'a Saturating<u64>
impl<'a> Add<Saturating<u64>> for &'a Saturating<u64>
type Output = <Saturating<u64> as Add<Saturating<u64>>>::Output
source§impl<'a> Add<Saturating<u128>> for &'a Saturating<u128>
impl<'a> Add<Saturating<u128>> for &'a Saturating<u128>
type Output = <Saturating<u128> as Add<Saturating<u128>>>::Output
source§impl<'a> Add<Saturating<usize>> for &'a Saturating<usize>
impl<'a> Add<Saturating<usize>> for &'a Saturating<usize>
type Output = <Saturating<usize> as Add<Saturating<usize>>>::Output
source§impl<'a, 'b> Add<&'b EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl<'a, 'b> Add<&'b EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a, 'b> Add<&'b EdwardsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl<'a, 'b> Add<&'b RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
impl<'a, 'b> Add<&'b RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl<'a, 'b> Add<&'b RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
impl<'a, 'b> Add<&'b RistrettoPoint> for &'a curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
source§impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a, 'b> Add<&'b AffineNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
source§impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
source§impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
impl<'a, 'b> Add<&'b ProjectiveNielsPoint> for &'a curve25519_dalek::edwards::EdwardsPoint
source§impl<'b> Add<&'b EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
impl<'b> Add<&'b EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl<'b> Add<&'b EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
impl<'b> Add<&'b EdwardsPoint> for curve25519_dalek::edwards::EdwardsPoint
type Output = EdwardsPoint
source§impl<'b> Add<&'b RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
impl<'b> Add<&'b RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl<'b> Add<&'b RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
impl<'b> Add<&'b RistrettoPoint> for curve25519_dalek::ristretto::RistrettoPoint
type Output = RistrettoPoint
source§impl<'lhs, 'rhs, T, const LANES: usize> Add<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where
T: SimdElement,
Simd<T, LANES>: Add<Simd<T, LANES>, Output = Simd<T, LANES>>,
LaneCount<LANES>: SupportedLaneCount,
impl<'lhs, 'rhs, T, const LANES: usize> Add<&'rhs Simd<T, LANES>> for &'lhs Simd<T, LANES>where T: SimdElement, Simd<T, LANES>: Add<Simd<T, LANES>, Output = Simd<T, LANES>>, LaneCount<LANES>: SupportedLaneCount,
source§impl<T, const LANES: usize> Add<&Simd<T, LANES>> for Simd<T, LANES>where
T: SimdElement,
Simd<T, LANES>: Add<Simd<T, LANES>, Output = Simd<T, LANES>>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const LANES: usize> Add<&Simd<T, LANES>> for Simd<T, LANES>where T: SimdElement, Simd<T, LANES>: Add<Simd<T, LANES>, Output = Simd<T, LANES>>, LaneCount<LANES>: SupportedLaneCount,
source§impl<T, const LANES: usize> Add<Simd<T, LANES>> for &Simd<T, LANES>where
T: SimdElement,
Simd<T, LANES>: Add<Simd<T, LANES>, Output = Simd<T, LANES>>,
LaneCount<LANES>: SupportedLaneCount,
impl<T, const LANES: usize> Add<Simd<T, LANES>> for &Simd<T, LANES>where T: SimdElement, Simd<T, LANES>: Add<Simd<T, LANES>, Output = Simd<T, LANES>>, LaneCount<LANES>: SupportedLaneCount,
source§impl<U> Add<B1> for UInt<U, B1>where
U: Unsigned + Add<B1>,
<U as Add<B1>>::Output: Unsigned,
impl<U> Add<B1> for UInt<U, B1>where U: Unsigned + Add<B1>, <U as Add<B1>>::Output: Unsigned,
UInt<U, B1> + B1 = UInt<U + B1, B0>
source§impl<U, B> Add<UTerm> for UInt<U, B>where
U: Unsigned,
B: Bit,
impl<U, B> Add<UTerm> for UInt<U, B>where U: Unsigned, B: Bit,
UInt<U, B> + UTerm = UInt<U, B>
source§impl<Ul, Ur> Add<NInt<Ur>> for NInt<Ul>where
Ul: Unsigned + NonZero + Add<Ur>,
Ur: Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned + NonZero,
impl<Ul, Ur> Add<NInt<Ur>> for NInt<Ul>where Ul: Unsigned + NonZero + Add<Ur>, Ur: Unsigned + NonZero, <Ul as Add<Ur>>::Output: Unsigned + NonZero,
N(Ul) + N(Ur) = N(Ul + Ur)
source§impl<Ul, Ur> Add<NInt<Ur>> for PInt<Ul>where
Ul: Unsigned + NonZero + Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>,
Ur: Unsigned + NonZero,
impl<Ul, Ur> Add<NInt<Ur>> for PInt<Ul>where Ul: Unsigned + NonZero + Cmp<Ur> + PrivateIntegerAdd<<Ul as Cmp<Ur>>::Output, Ur>, Ur: Unsigned + NonZero,
P(Ul) + N(Ur)
: We resolve this with our PrivateAdd
source§impl<Ul, Ur> Add<PInt<Ur>> for NInt<Ul>where
Ul: Unsigned + NonZero,
Ur: Unsigned + NonZero + Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>,
impl<Ul, Ur> Add<PInt<Ur>> for NInt<Ul>where Ul: Unsigned + NonZero, Ur: Unsigned + NonZero + Cmp<Ul> + PrivateIntegerAdd<<Ur as Cmp<Ul>>::Output, Ul>,
N(Ul) + P(Ur)
: We resolve this with our PrivateAdd
source§impl<Ul, Ur> Add<PInt<Ur>> for PInt<Ul>where
Ul: Unsigned + NonZero + Add<Ur>,
Ur: Unsigned + NonZero,
<Ul as Add<Ur>>::Output: Unsigned + NonZero,
impl<Ul, Ur> Add<PInt<Ur>> for PInt<Ul>where Ul: Unsigned + NonZero + Add<Ur>, Ur: Unsigned + NonZero, <Ul as Add<Ur>>::Output: Unsigned + NonZero,
P(Ul) + P(Ur) = P(Ul + Ur)
source§impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B0>where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B0>where Ul: Unsigned + Add<Ur>, Ur: Unsigned,
UInt<Ul, B0> + UInt<Ur, B0> = UInt<Ul + Ur, B0>
source§impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B1>where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
impl<Ul, Ur> Add<UInt<Ur, B0>> for UInt<Ul, B1>where Ul: Unsigned + Add<Ur>, Ur: Unsigned,
UInt<Ul, B1> + UInt<Ur, B0> = UInt<Ul + Ur, B1>
source§impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0>where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B0>where Ul: Unsigned + Add<Ur>, Ur: Unsigned,
UInt<Ul, B0> + UInt<Ur, B1> = UInt<Ul + Ur, B1>
source§impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B1>where
Ul: Unsigned + Add<Ur>,
Ur: Unsigned,
<Ul as Add<Ur>>::Output: Add<B1>,
impl<Ul, Ur> Add<UInt<Ur, B1>> for UInt<Ul, B1>where Ul: Unsigned + Add<Ur>, Ur: Unsigned, <Ul as Add<Ur>>::Output: Add<B1>,
UInt<Ul, B1> + UInt<Ur, B1> = UInt<(Ul + Ur) + B1, B0>