Skip to main content

render_rows

Function render_rows 

Source
pub fn render_rows(rows: &[Row], settings: &RenderSettings) -> String
Expand description

Renders rows using the configured output format.

ยงExamples

use osp_cli::core::output::OutputFormat;
use osp_cli::row;
use osp_cli::ui::{RenderSettings, render_rows};

let rendered = render_rows(
    &[row! { "uid" => "alice" }],
    &RenderSettings::test_plain(OutputFormat::Json),
);

assert!(rendered.contains("\"uid\": \"alice\""));