Struct rug::integer::ValidInteger [] [src]

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

A validated string that can always be converted to an Integer.

See the Integer::valid_str_radix method.

Examples

use rug::Integer;
use rug::integer::ValidInteger;
// This string is correct in radix 10, it cannot fail.
let s = "12345";
let valid: ValidInteger = match Integer::valid_str_radix(s, 10) {
    Ok(valid) => valid,
    Err(_) => unreachable!(),
};
let i = Integer::from(valid);
assert_eq!(i, 12345);

Trait Implementations

impl<'a> Clone for ValidInteger<'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 ValidInteger<'a>
[src]

[src]

Formats the value using the given formatter.