Wraps `console` to offer pagination features.
(
console: &'a mut dyn Console,
yielder: Option<Rc<RefCell<dyn Yielder>>>,
)
| 51 | impl<'a> Pager<'a> { |
| 52 | /// Wraps `console` to offer pagination features. |
| 53 | pub(crate) fn new( |
| 54 | console: &'a mut dyn Console, |
| 55 | yielder: Option<Rc<RefCell<dyn Yielder>>>, |
| 56 | ) -> io::Result<Self> { |
| 57 | let size = console.size_chars()?; |
| 58 | let more_message = if is_narrow(console) { MORE_MESSAGE_NARROW } else { MORE_MESSAGE_WIDE }; |
| 59 | Ok(Self { console, yielder, size, more_message, cur_columns: 0, cur_lines: 0 }) |
| 60 | } |
| 61 | |
| 62 | /// Returns the maximum number of columns of the console. |
| 63 | pub(crate) fn columns(&self) -> u16 { |
nothing calls this directly
no test coverage detected