pub struct ConstInclusiveRange<const MIN: i128, const MAX: i128>
where
Assert<{ _ }>: IsAllowed;Expand description
Const inclusive range for iterators with Ranged output and array indexing
Do not use directly, use r! macro instead
§Example
let mut fibonacci = [0; 10];
fibonacci[0] = 1;
fibonacci[1] = 1;
for i in r!(2..=9) {
fibonacci[i.expand()] = fibonacci[(i-r!(1)).expand()] + fibonacci[(i-r!(2)).expand()];
}
let fib2345: [_; 4] = fibonacci[r!(2..=5)];
assert_eq!(fib2345, [2,3,5,8]);
Trait Implementations§
Source§impl<const MIN: i128, const MAX: i128> Clone for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> Clone for ConstInclusiveRange<MIN, MAX>
Source§fn clone(&self) -> ConstInclusiveRange<MIN, MAX>
fn clone(&self) -> ConstInclusiveRange<MIN, MAX>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<T, const N: usize, const MIN: i128, const MAX: i128> Index<ConstInclusiveRange<MIN, MAX>> for [T; N]
impl<T, const N: usize, const MIN: i128, const MAX: i128> Index<ConstInclusiveRange<MIN, MAX>> for [T; N]
Source§type Output = [T; { _ }]
type Output = [T; { _ }]
The returned type after indexing.
Source§impl<T, const N: usize, const MIN: i128, const MAX: i128> IndexMut<ConstInclusiveRange<MIN, MAX>> for [T; N]
impl<T, const N: usize, const MIN: i128, const MAX: i128> IndexMut<ConstInclusiveRange<MIN, MAX>> for [T; N]
Source§impl<const MIN: i128, const MAX: i128> IntoIterator for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> IntoIterator for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> Copy for ConstInclusiveRange<MIN, MAX>
Auto Trait Implementations§
impl<const MIN: i128, const MAX: i128> Freeze for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> RefUnwindSafe for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> Send for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> Sync for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> Unpin for ConstInclusiveRange<MIN, MAX>
impl<const MIN: i128, const MAX: i128> UnwindSafe for ConstInclusiveRange<MIN, MAX>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more