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