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; 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<'a, 'b> Mul for &'b f64
impl<'a> Mul for f64
impl<'a> Mul for &'a f64
impl Mul for f64
impl<'a, 'b> Mul for &'b f32
impl<'a> Mul for f32
impl<'a> Mul for &'a f32
impl Mul for f32
impl<'a, 'b> Mul for &'b i64
impl<'a> Mul for i64
impl<'a> Mul for &'a i64
impl Mul for i64
impl<'a, 'b> Mul for &'b i32
impl<'a> Mul for i32
impl<'a> Mul for &'a i32
impl Mul for i32
impl<'a, 'b> Mul for &'b i16
impl<'a> Mul for i16
impl<'a> Mul for &'a i16
impl Mul for i16
impl<'a, 'b> Mul for &'b i8
impl<'a> Mul for i8
impl<'a> Mul for &'a i8
impl Mul for i8
impl<'a, 'b> Mul for &'b isize
impl<'a> Mul for isize
impl<'a> Mul for &'a isize
impl Mul for isize
impl<'a, 'b> Mul for &'b u64
impl<'a> Mul for u64
impl<'a> Mul for &'a u64
impl Mul for u64
impl<'a, 'b> Mul for &'b u32
impl<'a> Mul for u32
impl<'a> Mul for &'a u32
impl Mul for u32
impl<'a, 'b> Mul for &'b u16
impl<'a> Mul for u16
impl<'a> Mul for &'a u16
impl Mul for u16
impl<'a, 'b> Mul for &'b u8
impl<'a> Mul for u8
impl<'a> Mul for &'a u8
impl Mul for u8
impl<'a, 'b> Mul for &'b usize
impl<'a> Mul for usize
impl<'a> Mul for &'a usize
impl Mul for usize
impl Mul for Wrapping<i64>
impl Mul for Wrapping<i32>
impl Mul for Wrapping<i16>
impl Mul for Wrapping<i8>
impl Mul for Wrapping<isize>
impl Mul for Wrapping<u64>
impl Mul for Wrapping<u32>
impl Mul for Wrapping<u16>
impl Mul for Wrapping<u8>
impl Mul for Wrapping<usize>
impl Mul for Duration