Trait rug::Assign[][src]

pub trait Assign<Src = Self> {
    fn assign(&mut self, src: Src);
}

Assigns to a number from another value.

Examples

use rug::Assign;
struct I(i32);
impl Assign<i16> for I {
    fn assign(&mut self, rhs: i16) {
        self.0 = rhs.into();
    }
}
let mut i = I(0);
i.assign(42_i16);
assert_eq!(i.0, 42);

Required methods

fn assign(&mut self, src: Src)[src]

Peforms the assignement.

Examples

use rug::{Assign, Integer};
let mut i = Integer::from(15);
assert_eq!(i, 15);
i.assign(23);
assert_eq!(i, 23);
Loading content...

Implementations on Foreign Types

impl Assign<i8> for i8[src]

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

impl Assign<i16> for i16[src]

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

impl Assign<i32> for i32[src]

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

impl Assign<i64> for i64[src]

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

impl Assign<i128> for i128[src]

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

impl Assign<isize> for isize[src]

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

impl Assign<u8> for u8[src]

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

impl Assign<u16> for u16[src]

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

impl Assign<u32> for u32[src]

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

impl Assign<u64> for u64[src]

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

impl Assign<u128> for u128[src]

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

impl Assign<usize> for usize[src]

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

impl Assign<f32> for f32[src]

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

impl Assign<f64> for f64[src]

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

impl Assign<&'_ str> for String[src]

impl<'a> Assign<&'a str> for Cow<'a, str>[src]

impl<'a> Assign<Cow<'a, str>> for Cow<'a, str>[src]

Loading content...

Implementors

impl Assign<&'_ bool> for Integer[src]

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

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

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

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

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

impl Assign<&'_ isize> for Integer[src]

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

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

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

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

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

impl Assign<&'_ usize> for Integer[src]

impl Assign<&'_ SmallFloat> for SmallFloat[src]

impl Assign<&'_ SmallInteger> for SmallInteger[src]

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

impl Assign<bool> for Integer[src]

impl Assign<i8> for Integer[src]

impl Assign<i16> for Integer[src]

impl Assign<i32> for Integer[src]

impl Assign<i64> for Integer[src]

impl Assign<i128> for Integer[src]

impl Assign<isize> for Integer[src]

impl Assign<u8> for Integer[src]

impl Assign<u16> for Integer[src]

impl Assign<u32> for Integer[src]

impl Assign<u64> for Integer[src]

impl Assign<u128> for Integer[src]

impl Assign<usize> for Integer[src]

impl Assign<SmallFloat> for SmallFloat[src]

impl Assign<SmallInteger> for SmallInteger[src]

impl Assign<Integer> for Integer[src]

impl<T> Assign<T> for Float where
    Self: AssignRound<T, Round = Round, Ordering = Ordering>, 
[src]

impl<T: ToSmall> Assign<T> for SmallFloat[src]

impl<T: ToSmall> Assign<T> for SmallInteger[src]

Loading content...