Enum fizzbuzz::Value [] [src]

pub enum Value {
    Fizz,
    Buzz,
    FizzBuzz,
    Number(u32),
}

A FizzBuzz value.

Unsigned integers can be converted to FizzBuzz values.

Examples

use fizzbuzz::Value::*;

let mut iter = (1..).map(fizzbuzz::Value::from);

assert_eq!(iter.next(), Some(Number(1)));
assert_eq!(iter.next(), Some(Number(2)));
assert_eq!(iter.next(), Some(Fizz));
assert_eq!(iter.next(), Some(Number(4)));
assert_eq!(iter.next(), Some(Buzz));
assert_eq!(iter.next(), Some(Fizz));
assert_eq!(iter.next(), Some(Number(7)));

Variants

Trait Implementations

impl Eq for Value
[src]

impl PartialEq for Value
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Copy for Value
[src]

impl Clone for Value
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for Value
[src]

Formats the value using the given formatter.

impl Hash for Value
[src]

Feeds this value into the given [Hasher]. Read more

Feeds a slice of this type into the given [Hasher]. Read more

impl From<u32> for Value
[src]

Performs the conversion.

impl Display for Value
[src]

Formats the value using the given formatter. Read more