```#[lang = "add"]
pub trait Add<RHS = Self> {
type Output;
#[must_use]
fn add(self, rhs: RHS) -> Self::Output;
}```

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, PartialEq)]
struct Point {
x: i32,
y: i32,
}

type Output = Point;

fn add(self, other: Point) -> Point {
Point {
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 });Run```

## 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, PartialEq)]
struct Point<T> {
x: T,
y: T,
}

// Notice that the implementation uses the associated type `Output`.
type Output = Point<T>;

fn add(self, other: Point<T>) -> Point<T> {
Point {
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 });Run```

## Associated Types

### `type Output`

The resulting type after applying the `+` operator.

## Required Methods

### ```#[must_use] fn add(self, rhs: RHS) -> Self::Output```

Performs the `+` operation.

## Implementors

•  `impl Add for i64x8 type Output = i64x8;` [src]
•  `impl Add for f64 type Output = f64x2;` [src]
•  `impl Add for u16x8 type Output = u16x8;` [src]
•  `impl Add for i16 type Output = i16x4;` [src]
•  `impl Add for i32x16 type Output = i32x16;` [src]
•  `impl Add for i32x2 type Output = i32x2;` [src]
•  `impl<'a> Add<&'a usize> for usize type Output = >::Output;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add for &'a f64 type Output = >::Output;` [src]
•  `impl<'a> Add<&'a i64> for i64 type Output = >::Output;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u32 type Output = u32x8;` [src]
•  `impl Add for f32x2 type Output = f32x2;` [src]
•  `impl<'a, 'b> Add<&'a u8> for &'b u8 type Output = >::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for u16x4 type Output = u16x4;` [src]
•  `impl Add for i16x32 type Output = i16x32;` [src]
•  `impl Add for i32x8 type Output = i32x8;` [src]
•  `impl<'a> Add for &'a u32 type Output = >::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for f64x2 type Output = f64x2;` [src]
•  `impl<'a, 'b> Add<&'a u16> for &'b u16 type Output = >::Output;` [src]
•  `impl<'a, 'b> Add<&'a f64> for &'b f64 type Output = >::Output;` [src]
•  `impl<'a, 'b> Add<&'a i64> for &'b i64 type Output = >::Output;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add<&'a f64> for f64 type Output = >::Output;` [src]
•  `impl Add for i16 type Output = i16x16;` [src]
•  `impl Add for u8 type Output = u8x32;` [src]
•  `impl Add for u32 type Output = u32;` [src]
•  `impl<'a, 'b> Add<&'a isize> for &'b isize type Output = >::Output;` [src]
•  `impl<'a, 'b> Add<&'a f32> for &'b f32 type Output = >::Output;` [src]
•  `impl Add for f64x8 type Output = f64x8;` [src]
•  `impl Add for u16x2 type Output = u16x2;` [src]
•  `impl Add for i32x16 type Output = i32x16;` [src]
•  `impl Add for i8 type Output = i8x8;` [src]
•  `impl<'a, 'b> Add<&'a i128> for &'b i128 type Output = >::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for u32 type Output = u32x16;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i32x4 type Output = i32x4;` [src]
•  `impl Add for i32x2 type Output = i32x2;` [src]
•  `impl Add for i16x8 type Output = i16x8;` [src]
•  `impl Add for u16 type Output = u16x16;` [src]
•  `impl Add for f32x4 type Output = f32x4;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for f32x8 type Output = f32x8;` [src]
•  `impl<'a> Add<&'a u16> for u16 type Output = >::Output;` [src]
•  `impl Add for i8x4 type Output = i8x4;` [src]
•  `impl Add for u64x2 type Output = u64x2;` [src]
•  `impl Add for i16x8 type Output = i16x8;` [src]
•  `impl<'a, 'b> Add<&'a u32> for &'b u32 type Output = >::Output;` [src]
•  `impl Add for u8x4 type Output = u8x4;` [src]
•  `impl Add for i8x32 type Output = i8x32;` [src]
•  `impl Add for u64x4 type Output = u64x4;` [src]
•  `impl Add for i8x8 type Output = i8x8;` [src]
•  `impl Add for i128 type Output = i128;` [src]
•  `impl Add for i16x4 type Output = i16x4;` [src]
•  `impl Add for u64x8 type Output = u64x8;` [src]
•  `impl Add for i16x32 type Output = i16x32;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i16 type Output = i16x32;` [src]
•  `impl Add for f64x4 type Output = f64x4;` [src]
•  `impl Add for u16x16 type Output = u16x16;` [src]
•  `impl Add for u32 type Output = u32x2;` [src]
•  `impl<'a> Add<&'a i8> for i8 type Output = >::Output;` [src]
•  `impl<'a> Add for &'a i64 type Output = >::Output;` [src]
•  `impl<'a> Add for &'a u8 type Output = >::Output;` [src]
•  `impl Add for u64x4 type Output = u64x4;` [src]
•  `impl<'a> Add<&'a i128> for i128 type Output = >::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for i64 type Output = i64x4;` [src]
•  `impl Add for u16x4 type Output = u16x4;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u16x8 type Output = u16x8;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a, 'b> Add<&'a i32> for &'b i32 type Output = >::Output;` [src]
•  `impl<'a> Add<&'a u128> for u128 type Output = >::Output;` [src]
•  `impl<'a> Add<&'a i32> for i32 type Output = >::Output;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i32 type Output = i32;` [src]
•  `impl Add for f32 type Output = f32x2;` [src]
•  `impl Add for u64x8 type Output = u64x8;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add for &'a i32 type Output = >::Output;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u16x32 type Output = u16x32;` [src]
•  `impl Add for u16x16 type Output = u16x16;` [src]
•  `impl Add for i16 type Output = i16;` [src]
•  `impl<'a> Add<&'a u64> for u64 type Output = >::Output;` [src]
•  `impl Add for u16x2 type Output = u16x2;` [src]
•  `impl Add for i16x2 type Output = i16x2;` [src]
•  `impl Add for u16 type Output = u16x4;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add<&'a u32> for u32 type Output = >::Output;` [src]
•  `impl Add for f64x2 type Output = f64x2;` [src]
•  `impl Add for f32 type Output = f32x4;` [src]
•  `impl<'a> Add for &'a u128 type Output = >::Output;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i8x16 type Output = i8x16;` [src]
•  `impl Add for f32 type Output = f32x8;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u64 type Output = u64x2;` [src]
•  `impl Add for i16 type Output = i16x2;` [src]
•  `impl Add for f32x8 type Output = f32x8;` [src]
•  `impl<'a> Add for &'a u16 type Output = >::Output;` [src]
•  `impl Add for i32 type Output = i32x4;` [src]
•  `impl Add for i64x4 type Output = i64x4;` [src]
•  `impl Add for i8x2 type Output = i8x2;` [src]
•  `impl Add for u8x8 type Output = u8x8;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for u32x8 type Output = u32x8;` [src]
•  `impl<'a> Add for &'a i16 type Output = >::Output;` [src]
•  `impl Add for i8 type Output = i8x2;` [src]
•  `impl Add for i64 type Output = i64;` [src]
•  `impl Add for u32x16 type Output = u32x16;` [src]
•  `impl Add for i16x16 type Output = i16x16;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u16 type Output = u16x32;` [src]
•  `impl Add for i8 type Output = i8x64;` [src]
•  `impl Add for u32x4 type Output = u32x4;` [src]
•  `impl Add for i8x8 type Output = i8x8;` [src]
•  `impl Add for u64 type Output = u64x8;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for u32x2 type Output = u32x2;` [src]
•  `impl Add for i64x4 type Output = i64x4;` [src]
•  `impl<'a> Add<&'a isize> for isize type Output = >::Output;` [src]
•  `impl Add for usize type Output = usize;` [src]
•  `impl Add for i8x2 type Output = i8x2;` [src]
•  `impl Add for u32x8 type Output = u32x8;` [src]
•  `impl Add for u8x4 type Output = u8x4;` [src]
•  `impl<'a, 'b> Add<&'a u128> for &'b u128 type Output = >::Output;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i16x16 type Output = i16x16;` [src]
•  `impl Add for u64 type Output = u64;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl<'a, 'b> Add<&'a usize> for &'b usize type Output = >::Output;` [src]
•  `impl Add for i8x4 type Output = i8x4;` [src]
•  `impl Add for u64 type Output = u64x4;` [src]
•  `impl Add for u8 type Output = u8x8;` [src]
•  `impl Add for i16 type Output = i16x8;` [src]
•  `impl Add for i8 type Output = i8x16;` [src]
•  `impl<'a, 'b> Add<&'a i8> for &'b i8 type Output = >::Output;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u8 type Output = u8x64;` [src]
•  `impl Add for i32x8 type Output = i32x8;` [src]
•  `impl Add for u8x64 type Output = u8x64;` [src]
•  `impl Add for f32x4 type Output = f32x4;` [src]
•  `impl Add for i8 type Output = i8;` [src]
•  `impl<'a> Add for &'a isize type Output = >::Output;` [src]
•  `impl Add for i32x4 type Output = i32x4;` [src]
•  `impl Add for u16 type Output = u16x2;` [src]
•  `impl Add for f64 type Output = f64x8;` [src]
•  `impl<'a> Add for &'a usize type Output = >::Output;` [src]
•  `impl Add for u16 type Output = u16x8;` [src]
•  `impl Add for i64x2 type Output = i64x2;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u8x2 type Output = u8x2;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for u8x2 type Output = u8x2;` [src]
•  `impl Add for i64 type Output = i64x2;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for f64 type Output = f64x4;` [src]
•  `impl Add for u8x32 type Output = u8x32;` [src]
•  `impl Add for i64x2 type Output = i64x2;` [src]
•  `impl Add for i32 type Output = i32x16;` [src]
•  `impl Add for u8 type Output = u8x16;` [src]
•  `impl<'a> Add<&'a f32> for f32 type Output = >::Output;` [src]
•  `impl<'a> Add for &'a f32 type Output = >::Output;` [src]
•  `impl Add for isize type Output = isize;` [src]
•  `impl Add for u16x32 type Output = u16x32;` [src]
•  `impl Add for u8 type Output = u8x2;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for u64x2 type Output = u64x2;` [src]
•  `impl<'a> Add for &'a u64 type Output = >::Output;` [src]
•  `impl<'a> Add for &'a i8 type Output = >::Output;` [src]
•  `impl Add for i8x16 type Output = i8x16;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i64x8 type Output = i64x8;` [src]
•  `impl Add for u128 type Output = u128;` [src]
•  `impl Add for i64 type Output = i64x8;` [src]
•  `impl Add for u8x16 type Output = u8x16;` [src]
•  `impl Add for i8 type Output = i8x4;` [src]
•  `impl Add for u8x32 type Output = u8x32;` [src]
•  `impl Add for i8 type Output = i8x32;` [src]
•  `impl Add for f64 type Output = f64;` [src]
•  `impl Add for u32x16 type Output = u32x16;` [src]
•  `impl Add for f32x16 type Output = f32x16;` [src]
•  `impl Add for u32x2 type Output = u32x2;` [src]
•  `impl Add for f32 type Output = f32;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for i8x64 type Output = i8x64;` [src]
•  `impl<'a> Add<&'a i16> for i16 type Output = >::Output;` [src]
•  `impl<'a> Add> for &'a Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl Add for u8x16 type Output = u8x16;` [src]
•  `impl Add for f32 type Output = f32x16;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i8x64 type Output = i8x64;` [src]
•  `impl Add for u8x64 type Output = u8x64;` [src]
•  `impl Add for f32x16 type Output = f32x16;` [src]
•  `impl Add for u32x4 type Output = u32x4;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i32 type Output = i32x2;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add for i16x4 type Output = i16x4;` [src]
•  `impl Add for f64x4 type Output = f64x4;` [src]
•  `impl Add for f32x2 type Output = f32x2;` [src]
•  `impl<'a> Add<&'a u8> for u8 type Output = >::Output;` [src]
•  `impl Add for Duration type Output = Duration;` [src]
•  `impl<'a, 'b> Add<&'a i16> for &'b i16 type Output = >::Output;` [src]
•  `impl Add for i32 type Output = i32x8;` [src]
•  `impl Add for u16 type Output = u16;` [src]
•  `impl Add for i16x2 type Output = i16x2;` [src]
•  `impl Add for u32 type Output = u32x4;` [src]
•  `impl<'a, 'b> Add<&'a u64> for &'b u64 type Output = >::Output;` [src]
•  `impl Add for f64x8 type Output = f64x8;` [src]
•  `impl Add for u8 type Output = u8x4;` [src]
•  `impl<'a> Add<&'a Wrapping> for Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a> Add for &'a i128 type Output = >::Output;` [src]
•  `impl Add for i8x32 type Output = i8x32;` [src]
•  `impl Add for u8x8 type Output = u8x8;` [src]
•  `impl Add for u8 type Output = u8;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl<'a, 'b> Add<&'a Wrapping> for &'b Wrapping type Output = as Add>>::Output;` [src]
•  `impl Add> for Wrapping type Output = Wrapping;` [src]
•  `impl<'a> Add> for Cow<'a, str> type Output = Cow<'a, str>;` [src]
•  `impl<'a> Add<&'a str> for String type Output = String;` [src]
•  `impl<'a> Add<&'a str> for Cow<'a, str> type Output = Cow<'a, str>;` [src]
•  `impl Add for Instant type Output = Instant;` [src]
•  `impl Add for SystemTime type Output = SystemTime;` [src]