mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-07-17 15:56:57 +02:00
add iter_dyn and iter_<dir>_fixed stubs
This commit is contained in:
parent
9c5bfafb7a
commit
e0781571c4
2 changed files with 25 additions and 1 deletions
|
|
@ -10,7 +10,7 @@ use super::*;
|
||||||
/// Center.align(W(40).max(H(20.max("Center"))))
|
/// Center.align(W(40).max(H(20.max("Center"))))
|
||||||
/// ].iter(), |x|x);
|
/// ].iter(), |x|x);
|
||||||
/// ```
|
/// ```
|
||||||
pub fn iter <
|
pub fn iter_dyn <
|
||||||
S: Screen, // Target screen
|
S: Screen, // Target screen
|
||||||
D, // Input doesn't need to be [Draw]able, output does
|
D, // Input doesn't need to be [Draw]able, output does
|
||||||
V: Fn()->I, // Function that returns the iterator
|
V: Fn()->I, // Function that returns the iterator
|
||||||
|
|
@ -20,6 +20,12 @@ pub fn iter <
|
||||||
thunk(move|_to: &mut S|{ todo!() })
|
thunk(move|_to: &mut S|{ todo!() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn iter <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
||||||
|
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
||||||
|
) -> 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>> (
|
pub fn iter_north <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
||||||
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
||||||
) -> impl Draw<S> {
|
) -> impl Draw<S> {
|
||||||
|
|
@ -32,12 +38,24 @@ pub fn iter_east <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
||||||
thunk(move|_to: &mut S|{ todo!() })
|
thunk(move|_to: &mut S|{ todo!() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn iter_east_fixed <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
||||||
|
_height: S::Unit, _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
||||||
|
) -> impl Draw<S> {
|
||||||
|
thunk(move|_to: &mut S|{ todo!() })
|
||||||
|
}
|
||||||
|
|
||||||
pub fn iter_south <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
pub fn iter_south <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
||||||
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
||||||
) -> impl Draw<S> {
|
) -> impl Draw<S> {
|
||||||
thunk(move|_to: &mut S|{ todo!() })
|
thunk(move|_to: &mut S|{ todo!() })
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn iter_south_fixed <'a, S: Screen, D: 'a, I: Iterator<Item = D>, U: Draw<S>> (
|
||||||
|
_height: S::Unit, _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
||||||
|
) -> impl Draw<S> {
|
||||||
|
thunk(move|_to: &mut S|{ todo!() })
|
||||||
|
}
|
||||||
|
|
||||||
pub fn iter_west <'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, usize)->U,
|
_iter: impl Fn()->I, _draw: impl Fn(D, usize)->U,
|
||||||
) -> impl Draw<S> {
|
) -> impl Draw<S> {
|
||||||
|
|
|
||||||
|
|
@ -171,6 +171,12 @@ impl Deref for Tui { type Target = Buffer; fn deref (&self) -> &Buffer { &self.0
|
||||||
|
|
||||||
impl DerefMut for Tui { fn deref_mut (&mut self) -> &mut Buffer { &mut self.0 } }
|
impl DerefMut for Tui { fn deref_mut (&mut self) -> &mut Buffer { &mut self.0 } }
|
||||||
|
|
||||||
|
impl AsMut<Buffer> for Tui {
|
||||||
|
fn as_mut (&mut self) -> &mut Buffer {
|
||||||
|
&mut self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl HasOrigin for Tui { fn origin (&self) -> Origin { Origin::NW } }
|
impl HasOrigin for Tui { fn origin (&self) -> Origin { Origin::NW } }
|
||||||
|
|
||||||
impl X<u16> for Tui {
|
impl X<u16> for Tui {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue