Trait rug::ops::DivFrom[][src]

pub trait DivFrom<Lhs = Self> {
    fn div_from(&mut self, lhs: Lhs);
}

Compound division and assignment to the rhs operand.

rhs.div_from(lhs) has the same effect as rhs = lhs / rhs.

Examples

use rug::ops::DivFrom;
struct I(i32);
impl DivFrom<i32> for I {
    fn div_from(&mut self, lhs: i32) {
        self.0 = lhs / self.0;
    }
}
let mut i = I(10);
i.div_from(42);
assert_eq!(i.0, 4);

Required methods

fn div_from(&mut self, lhs: Lhs)[src]

Peforms the division.

Examples

use rug::{ops::DivFrom, Integer};
let mut rhs = Integer::from(5);
rhs.div_from(50);
// rhs = 50 / 5
assert_eq!(rhs, 10);
Loading content...

Implementations on Foreign Types

impl DivFrom<i8> for i8[src]

impl DivFrom<&'_ i8> for i8[src]

impl DivFrom<i16> for i16[src]

impl DivFrom<&'_ i16> for i16[src]

impl DivFrom<i32> for i32[src]

impl DivFrom<&'_ i32> for i32[src]

impl DivFrom<i64> for i64[src]

impl DivFrom<&'_ i64> for i64[src]

impl DivFrom<i128> for i128[src]

impl DivFrom<&'_ i128> for i128[src]

impl DivFrom<isize> for isize[src]

impl DivFrom<&'_ isize> for isize[src]

impl DivFrom<u8> for u8[src]

impl DivFrom<&'_ u8> for u8[src]

impl DivFrom<u16> for u16[src]

impl DivFrom<&'_ u16> for u16[src]

impl DivFrom<u32> for u32[src]

impl DivFrom<&'_ u32> for u32[src]

impl DivFrom<u64> for u64[src]

impl DivFrom<&'_ u64> for u64[src]

impl DivFrom<u128> for u128[src]

impl DivFrom<&'_ u128> for u128[src]

impl DivFrom<usize> for usize[src]

impl DivFrom<&'_ usize> for usize[src]

impl DivFrom<f32> for f32[src]

impl DivFrom<&'_ f32> for f32[src]

impl DivFrom<f64> for f64[src]

impl DivFrom<&'_ f64> for f64[src]

Loading content...

Implementors

impl DivFrom<&'_ f32> for Float[src]

impl DivFrom<&'_ f64> for Float[src]

impl DivFrom<&'_ i8> for Float[src]

impl DivFrom<&'_ i8> for Integer[src]

impl DivFrom<&'_ i16> for Float[src]

impl DivFrom<&'_ i16> for Integer[src]

impl DivFrom<&'_ i32> for Float[src]

impl DivFrom<&'_ i32> for Integer[src]

impl DivFrom<&'_ i64> for Float[src]

impl DivFrom<&'_ i64> for Integer[src]

impl DivFrom<&'_ i128> for Float[src]

impl DivFrom<&'_ i128> for Integer[src]

impl DivFrom<&'_ u8> for Float[src]

impl DivFrom<&'_ u8> for Integer[src]

impl DivFrom<&'_ u16> for Float[src]

impl DivFrom<&'_ u16> for Integer[src]

impl DivFrom<&'_ u32> for Float[src]

impl DivFrom<&'_ u32> for Integer[src]

impl DivFrom<&'_ u64> for Float[src]

impl DivFrom<&'_ u64> for Integer[src]

impl DivFrom<&'_ u128> for Float[src]

impl DivFrom<&'_ u128> for Integer[src]

impl DivFrom<&'_ Float> for Float[src]

impl DivFrom<&'_ Integer> for Float[src]

impl DivFrom<&'_ Integer> for Integer[src]

impl DivFrom<f32> for Float[src]

impl DivFrom<f64> for Float[src]

impl DivFrom<i8> for Float[src]

impl DivFrom<i8> for Integer[src]

impl DivFrom<i16> for Float[src]

impl DivFrom<i16> for Integer[src]

impl DivFrom<i32> for Float[src]

impl DivFrom<i32> for Integer[src]

impl DivFrom<i64> for Float[src]

impl DivFrom<i64> for Integer[src]

impl DivFrom<i128> for Float[src]

impl DivFrom<i128> for Integer[src]

impl DivFrom<u8> for Float[src]

impl DivFrom<u8> for Integer[src]

impl DivFrom<u16> for Float[src]

impl DivFrom<u16> for Integer[src]

impl DivFrom<u32> for Float[src]

impl DivFrom<u32> for Integer[src]

impl DivFrom<u64> for Float[src]

impl DivFrom<u64> for Integer[src]

impl DivFrom<u128> for Float[src]

impl DivFrom<u128> for Integer[src]

impl DivFrom<Float> for Float[src]

impl DivFrom<Integer> for Float[src]

impl DivFrom<Integer> for Integer[src]

Loading content...