Trait std::ops::Mul[src]
pub trait Mul<RHS, Result> {
fn mul<RHS, Result>(&self, rhs: &RHS) -> Result;
}The Mul trait is used to specify the functionality of *.
Example
A trivial implementation of Mul. When Foo * Foo happens, it ends up
calling mul, and therefore, main prints Multiplying!.
struct Foo; impl Mul<Foo, Foo> for Foo { fn mul(&self, _rhs: &Foo) -> Foo { println!("Multiplying!"); *self } } fn main() { Foo * Foo; }
Required Methods
fn mul<RHS, Result>(&self, rhs: &RHS) -> Result
The method for the * operator
Implementors
impl Mul<uint, uint> for uintimpl Mul<u8, u8> for u8impl Mul<u16, u16> for u16impl Mul<u32, u32> for u32impl Mul<u64, u64> for u64impl Mul<int, int> for intimpl Mul<i8, i8> for i8impl Mul<i16, i16> for i16impl Mul<i32, i32> for i32impl Mul<i64, i64> for i64impl Mul<f32, f32> for f32impl Mul<f64, f64> for f64