pub struct Inc<T>(pub T);
Expand description
An increasing sequence.
The type T
must implement AddAssign
+
num::One
+ Clone
, which is true for all primitive numeric
types. The output value increases by 1 on each call.
Example:
use boulder::{Generator, Inc};
let mut g = Inc(5);
assert_eq!(g.generate(), 5);
assert_eq!(g.generate(), 6);
assert_eq!(g.generate(), 7);
Tuple Fields
0: T
Trait Implementations
Auto Trait Implementations
impl<T> RefUnwindSafe for Inc<T> where
T: RefUnwindSafe,
impl<T> Send for Inc<T> where
T: Send,
impl<T> Sync for Inc<T> where
T: Sync,
impl<T> Unpin for Inc<T> where
T: Unpin,
impl<T> UnwindSafe for Inc<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