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