pub struct Some<T>(pub T);
Expand description

Wrap sequence of T in Option<T>.

This converts a generator of T into a stream of Option<T> by wrapping each value in Some.

Example:

use boulder::{Generator, Inc, Some as GSome};

let mut g = GSome(Inc(2));
assert_eq!(g.generate(), Some(2));
assert_eq!(g.generate(), Some(3));
assert_eq!(g.generate(), Some(4));

Tuple Fields

0: T

Trait Implementations

The output type.

Make a new object. Read more

Available on crate feature persian-rug only.

The output type.

Available on crate feature persian-rug only.

Make a new object. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.