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

Function refill_and_page

std/src/console/format.rs:127–136  ·  view source on GitHub ↗

Same as `refill` but prints the lines of each paragraph to a pager instead of returning them and prefixes them with an optional `indent`. The width is automatically determined from the console's size.

(
    pager: &mut Pager<'_>,
    paragraphs: P,
    indent: &str,
)

Source from the content-addressed store, hash-verified

125///
126/// The width is automatically determined from the console's size.
127pub(crate) async fn refill_and_page<S: AsRef<str>, P: IntoIterator<Item = S>>(
128 pager: &mut Pager<'_>,
129 paragraphs: P,
130 indent: &str,
131) -> io::Result<()> {
132 for line in refill_many(paragraphs, indent, usize::from(pager.columns())) {
133 pager.print(&line).await?;
134 }
135 Ok(())
136}
137
138#[cfg(test)]
139mod tests {

Callers 2

describeMethod · 0.85
summaryMethod · 0.85

Calls 3

refill_manyFunction · 0.85
columnsMethod · 0.80
printMethod · 0.45

Tested by

no test coverage detected