Skip to main content

print_page

Function print_page 

Source
pub fn print_page<T>(
    rows: &[T],
    total: i64,
    window: Window,
    json: bool,
    to_json: impl Fn(&T) -> Value,
    to_line: impl Fn(&T) -> String,
)
Expand description

Prints one page, in whichever of the two shapes was asked for.

The to_line closure carries the Palette, which is what keeps the json branch structurally unable to reach one. order list --json is the one caller that does not go through here — it batches an authorization lookup its to_json needs, and folding that in would make the text path pay for a query it never reads — so it calls json_page and print_footer directly instead.