add index to all iter helpers

This commit is contained in:
facile pop culture reference 2026-06-16 14:58:48 +03:00
parent 2dc501c184
commit 29035d0b36
3 changed files with 14 additions and 10 deletions

View file

@ -11,23 +11,23 @@ use super::*;
/// ].iter(), |x|x);
/// ```
pub fn iter <
S: Screen,
D: Draw<S>,
V: Fn()->I,
I: Iterator<Item = D>,
F: Fn(&D)->dyn Draw<S>,
S: Screen, // Target screen
D, // Input doesn't need to be [Draw]able, output does
V: Fn()->I, // Function that returns the iterator
I: Iterator<Item = D>, // Type of the iterator
F: Fn(&D, usize)->dyn Draw<S>, // Function that returns [Draw]able from iterator item
> (_items: V, _cb: F) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
pub fn iter_north <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
_iter: impl Fn()->I, _draw: impl Fn(D)->U,
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
pub fn iter_east <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
_iter: impl Fn()->I, _draw: impl Fn(D)->U,
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}
@ -39,8 +39,7 @@ pub fn iter_south <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
}
pub fn iter_west <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
_iter: impl Fn()->I, _draw: impl Fn(D)->U,
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
) -> impl Draw<S> {
thunk(move|_to: &mut S|{ todo!() })
}