std::num::One - Rust
Description: API documentation for the Rust `One` trait in crate `std`.
Keywords: rust, rustlang, rust-lang, One

# Trait std::num::One [−] [src]

    pub trait One {
        fn one() -> Self;
    }

Deprecated since 1.11.0

: no longer used for Iterator::product

🔬 This is a nightly-only experimental API. (`zero_one` #27739)

unsure of placement, wants to use associated constants

Types that have a "one" value.

This trait is intended for use in conjunction with `Mul`, as an identity: `x * T::one() == x`.

## Required Methods

### `fn one() -> Self`

Deprecated since 1.11.0

: no longer used for Iterator::product

🔬 This is a nightly-only experimental API. (`zero_one` #27739)

unsure of placement, wants to use associated constants

The "one" (usually, multiplicative identity) for this type.

## Implementors

- `impl One for u8`
- `impl One for u16`
- `impl One for u32`
- `impl One for u64`
- `impl One for usize`
- `impl One for i8`
- `impl One for i16`
- `impl One for i32`
- `impl One for i64`
- `impl One for isize`
- `impl One for u128`
- `impl One for i128`
- `impl One for f32`
- `impl One for f64`

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
⇤
  Move up in search results
⇥
  Move down in search results
⏎
  Go to active search result
+
  Collapse/expand 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`)