From e0781571c42cb72e7445a2adbdb7a99e37600562 Mon Sep 17 00:00:00 2001 From: facile pop culture reference Date: Fri, 19 Jun 2026 20:23:42 +0300 Subject: [PATCH] add iter_dyn and iter__fixed stubs --- src/space/iter.rs | 20 +++++++++++++++++++- src/term.rs | 6 ++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/space/iter.rs b/src/space/iter.rs index 4277d05..c27b73c 100644 --- a/src/space/iter.rs +++ b/src/space/iter.rs @@ -10,7 +10,7 @@ use super::*; /// Center.align(W(40).max(H(20.max("Center")))) /// ].iter(), |x|x); /// ``` -pub fn iter < +pub fn iter_dyn < S: Screen, // Target screen D, // Input doesn't need to be [Draw]able, output does V: Fn()->I, // Function that returns the iterator @@ -20,6 +20,12 @@ pub fn iter < thunk(move|_to: &mut S|{ todo!() }) } +pub fn iter <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( + _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, +) -> impl Draw { + thunk(move|_to: &mut S|{ todo!() }) +} + pub fn iter_north <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, ) -> impl Draw { @@ -32,12 +38,24 @@ pub fn iter_east <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( thunk(move|_to: &mut S|{ todo!() }) } +pub fn iter_east_fixed <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( + _height: S::Unit, _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, +) -> impl Draw { + thunk(move|_to: &mut S|{ todo!() }) +} + pub fn iter_south <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, ) -> impl Draw { thunk(move|_to: &mut S|{ todo!() }) } +pub fn iter_south_fixed <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( + _height: S::Unit, _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, +) -> impl Draw { + thunk(move|_to: &mut S|{ todo!() }) +} + pub fn iter_west <'a, S: Screen, D: 'a, I: Iterator, U: Draw> ( _iter: impl Fn()->I, _draw: impl Fn(D, usize)->U, ) -> impl Draw { diff --git a/src/term.rs b/src/term.rs index 622f636..63c9b95 100644 --- a/src/term.rs +++ b/src/term.rs @@ -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 AsMut for Tui { + fn as_mut (&mut self) -> &mut Buffer { + &mut self.0 + } +} + impl HasOrigin for Tui { fn origin (&self) -> Origin { Origin::NW } } impl X for Tui {