Struct rug::complex::ValidComplex [] [src]

pub struct ValidComplex<'a> { /* fields omitted */ }

A validated string that can always be converted to a Complex.

See the Complex::valid_str_radix method.

Examples

use rug::Complex;
use rug::complex::ValidComplex;
// This string is correct in radix 10, it cannot fail.
let s = "(1.25e-1 2.37e+2)";
let valid: ValidComplex = match Complex::valid_str_radix(s, 10) {
    Ok(valid) => valid,
    Err(_) => unreachable!(),
};
let c = Complex::with_val(53, valid);
assert_eq!(c, (0.125, 237));

Trait Implementations

impl<'a> Clone for ValidComplex<'a>
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl<'a> Debug for ValidComplex<'a>
[src]

[src]

Formats the value using the given formatter.