pub struct Replies<T> { /* private fields */ }Expand description
Drops the terminal’s answers from what’s read. A unit is what’s read at once (a key event
for the loop, a byte in a test) with the bytes it stands for: Alt+] is ESC ], Ctrl+G is
BEL. Units that stand for none, such as clicks, end any answer under way.
Implementations§
Source§impl<T> Replies<T>
impl<T> Replies<T>
Sourcepub fn take(&mut self, unit: T, bytes: Option<&[u8]>) -> Vec<T>
pub fn take(&mut self, unit: T, bytes: Option<&[u8]>) -> Vec<T>
Takes one unit, and gives back those that are input, in order: none while it may still be an answer’s start, and what was held with it once it isn’t.
Sourcepub fn release(&mut self) -> Vec<T>
pub fn release(&mut self) -> Vec<T>
No more input came: what’s held wasn’t an answer’s start after all, and goes on as it was. Not where a wait read the start: the rest of that answer is still to come.
Sourcepub fn waiting(&self, now: Instant) -> bool
pub fn waiting(&self, now: Instant) -> bool
Whether something is held that, with answers owed, may be an answer’s start, so more is worth waiting a moment for before what’s held is given back.
Sourcepub fn owe(&mut self, owed: Owed)
pub fn owe(&mut self, owed: Owed)
Takes what a wait left owing: answers that may still come, and how far into one it read, so the rest of that one is dropped too.
Sourcepub fn take_background(&mut self) -> Option<Vec<u8>>
pub fn take_background(&mut self) -> Option<Vec<u8>>
The background colour the last answer read whole said, as rgb:…, once.