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
sourceimpl<C, T> GeneratorWithPersianRug<C> for Some<T> where
T: GeneratorWithPersianRug<C>,
C: Context,
impl<C, T> GeneratorWithPersianRug<C> for Some<T> where
T: GeneratorWithPersianRug<C>,
C: Context,
type Output = Option<<T as GeneratorWithPersianRug<C>>::Output>
type Output = Option<<T as GeneratorWithPersianRug<C>>::Output>
Available on crate feature
persian-rug
only.The output type.
Auto Trait Implementations
impl<T> RefUnwindSafe for Some<T> where
T: RefUnwindSafe,
impl<T> Send for Some<T> where
T: Send,
impl<T> Sync for Some<T> where
T: Sync,
impl<T> Unpin for Some<T> where
T: Unpin,
impl<T> UnwindSafe for Some<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more