MCPcopy Index your code
hub / github.com/endbasic/endbasic / new

Method new

std/src/console/pager.rs:53–60  ·  view source on GitHub ↗

Wraps `console` to offer pagination features.

(
        console: &'a mut dyn Console,
        yielder: Option<Rc<RefCell<dyn Yielder>>>,
    )

Source from the content-addressed store, hash-verified

51impl<'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 {

Callers

nothing calls this directly

Calls 2

is_narrowFunction · 0.85
size_charsMethod · 0.45

Tested by

no test coverage detected