# Trait num_traits::Num [−] [src]

    pub trait Num: Zero + One + NumOps<Self, Self> + PartialEq<Self> {
        type FromStrRadixErr;
        fn from_str_radix(
            str: &str,
            radix: u32
        ) -> Result<Self, Self::FromStrRadixErr>;
    }

The base trait for numeric types, covering `0` and `1` values, comparisons, basic numeric operations, and string conversion.

## Associated Types

### `type FromStrRadixErr`

## Required Methods

### `fn from_str_radix(str: &str, radix: u32) -> Result<Self, Self::FromStrRadixErr>`

Convert from a string and radix <= 36.

# Examples

    use num_traits::Num;

    let result = <i32 as Num>::from_str_radix("27", 10);
    assert_eq!(result, Ok(27));

    let result = <i32 as Num>::from_str_radix("foo", 10);
    assert!(result.is_err());

## Implementations on Foreign Types

### `impl Num for u32`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<u32, ParseIntError>`
[src]

### `impl Num for u64`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<u64, ParseIntError>`
[src]

### `impl Num for usize`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<usize, ParseIntError>`
[src]

### `impl Num for u8`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<u8, ParseIntError>`
[src]

### `impl Num for i8`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<i8, ParseIntError>`
[src]

### `impl Num for f64`
[src]

#### `type FromStrRadixErr = ParseFloatError`

#### `fn from_str_radix(
src: &str,
radix: u32
) -> Result<f64, <f64 as Num>::FromStrRadixErr>`
[src]

### `impl<T> Num for Wrapping<T> where
T: Num,
Wrapping<T>: Mul<Wrapping<T>>,
Wrapping<T>: Add<Wrapping<T>>,
Wrapping<T>: Div<Wrapping<T>>,
Wrapping<T>: Rem<Wrapping<T>>,
Wrapping<T>: Sub<Wrapping<T>>,
<Wrapping<T> as Add<Wrapping<T>>>::Output == Wrapping<T>,
<Wrapping<T> as Sub<Wrapping<T>>>::Output == Wrapping<T>,
<Wrapping<T> as Mul<Wrapping<T>>>::Output == Wrapping<T>,
<Wrapping<T> as Div<Wrapping<T>>>::Output == Wrapping<T>,
<Wrapping<T> as Rem<Wrapping<T>>>::Output == Wrapping<T>,`
[src]

#### `type FromStrRadixErr = <T as Num>::FromStrRadixErr`

#### `fn from_str_radix(
str: &str,
radix: u32
) -> Result<Wrapping<T>, <Wrapping<T> as Num>::FromStrRadixErr>`
[src]

### `impl Num for i16`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<i16, ParseIntError>`
[src]

### `impl Num for i64`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<i64, ParseIntError>`
[src]

### `impl Num for isize`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<isize, ParseIntError>`
[src]

### `impl Num for f32`
[src]

#### `type FromStrRadixErr = ParseFloatError`

#### `fn from_str_radix(
src: &str,
radix: u32
) -> Result<f32, <f32 as Num>::FromStrRadixErr>`
[src]

### `impl Num for i32`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<i32, ParseIntError>`
[src]

### `impl Num for u16`
[src]

#### `type FromStrRadixErr = ParseIntError`

#### `fn from_str_radix(s: &str, radix: u32) -> Result<u16, ParseIntError>`
[src]

## Implementors

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)