Trait std::ops::Mul
[−]
[src]
pub trait Mul<RHS = Self> { type Output; fn mul(self, rhs: RHS) -> Self::Output; }
The Mul
trait is used to specify the functionality of *
.
Examples
A trivial implementation of Mul
. When Foo * Foo
happens, it ends up
calling mul
, and therefore, main
prints Multiplying!
.
use std::ops::Mul; #[derive(Copy, Clone)] struct Foo; impl Mul for Foo { type Output = Foo; fn mul(self, _rhs: Foo) -> Foo { println!("Multiplying!"); self } } fn main() { Foo * Foo; }
Associated Types
type Output
The resulting type after applying the *
operator
Required Methods
Implementors
impl Mul<Wrapping<usize>> for Wrapping<usize>
impl Mul<Wrapping<u8>> for Wrapping<u8>
impl Mul<Wrapping<u16>> for Wrapping<u16>
impl Mul<Wrapping<u32>> for Wrapping<u32>
impl Mul<Wrapping<u64>> for Wrapping<u64>
impl Mul<Wrapping<isize>> for Wrapping<isize>
impl Mul<Wrapping<i8>> for Wrapping<i8>
impl Mul<Wrapping<i16>> for Wrapping<i16>
impl Mul<Wrapping<i32>> for Wrapping<i32>
impl Mul<Wrapping<i64>> for Wrapping<i64>
impl Mul<usize> for usize
impl<'a> Mul<usize> for &'a usize
impl<'a> Mul<&'a usize> for usize
impl<'a, 'b> Mul<&'a usize> for &'b usize
impl Mul<u8> for u8
impl<'a> Mul<u8> for &'a u8
impl<'a> Mul<&'a u8> for u8
impl<'a, 'b> Mul<&'a u8> for &'b u8
impl Mul<u16> for u16
impl<'a> Mul<u16> for &'a u16
impl<'a> Mul<&'a u16> for u16
impl<'a, 'b> Mul<&'a u16> for &'b u16
impl Mul<u32> for u32
impl<'a> Mul<u32> for &'a u32
impl<'a> Mul<&'a u32> for u32
impl<'a, 'b> Mul<&'a u32> for &'b u32
impl Mul<u64> for u64
impl<'a> Mul<u64> for &'a u64
impl<'a> Mul<&'a u64> for u64
impl<'a, 'b> Mul<&'a u64> for &'b u64
impl Mul<isize> for isize
impl<'a> Mul<isize> for &'a isize
impl<'a> Mul<&'a isize> for isize
impl<'a, 'b> Mul<&'a isize> for &'b isize
impl Mul<i8> for i8
impl<'a> Mul<i8> for &'a i8
impl<'a> Mul<&'a i8> for i8
impl<'a, 'b> Mul<&'a i8> for &'b i8
impl Mul<i16> for i16
impl<'a> Mul<i16> for &'a i16
impl<'a> Mul<&'a i16> for i16
impl<'a, 'b> Mul<&'a i16> for &'b i16
impl Mul<i32> for i32
impl<'a> Mul<i32> for &'a i32
impl<'a> Mul<&'a i32> for i32
impl<'a, 'b> Mul<&'a i32> for &'b i32
impl Mul<i64> for i64
impl<'a> Mul<i64> for &'a i64
impl<'a> Mul<&'a i64> for i64
impl<'a, 'b> Mul<&'a i64> for &'b i64
impl Mul<f32> for f32
impl<'a> Mul<f32> for &'a f32
impl<'a> Mul<&'a f32> for f32
impl<'a, 'b> Mul<&'a f32> for &'b f32
impl Mul<f64> for f64
impl<'a> Mul<f64> for &'a f64
impl<'a> Mul<&'a f64> for f64
impl<'a, 'b> Mul<&'a f64> for &'b f64
impl Mul<u8x16> for u8x16
impl Mul<u16x8> for u16x8
impl Mul<u32x4> for u32x4
impl Mul<u64x2> for u64x2
impl Mul<i8x16> for i8x16
impl Mul<i16x8> for i16x8
impl Mul<i32x4> for i32x4
impl Mul<i64x2> for i64x2
impl Mul<f32x4> for f32x4
impl Mul<f64x2> for f64x2
impl Mul<u32> for Duration