pub struct Output {
pub name: Option<Loose<String>>,
pub format: Option<Loose<String>>,
pub queries: Option<Loose<Vec<String>>>,
pub when: Option<Loose<OneOf<String, bool>>>,
pub destination: Option<Loose<OneOf<Destination, Vec<Loose<Destination>>>>>,
pub template: Option<Loose<Template>>,
pub for_each: Option<Loose<OneOf<ForEach, bool>>>,
pub file_name: Option<Loose<String>>,
pub on_empty: Option<Loose<OnEmpty>>,
pub extension: Maybe<Loose<Option<OneOf<String, bool>>>>,
pub options: Map<Value>,
}Expand description
How a report’s result is written and where it goes. Besides the keys below, each format takes its own options (for example delimiter for delimited, columns for fixed_width, text for message); they are documented with the formats.
Fields§
§name: Option<Loose<String>>Names the output so other outputs and Set overrides can refer to it (outputs.<name> in a message, attach:). Also the default file name (<name>.<ext>). Unique within the report.
format: Option<Loose<String>>The output format: message (built in: a short headline rendered from the results), or csv, delimited, fixed_width, parquet or xlsx (each a plugin). Default: csv, or the project’s default_output.
queries: Option<Loose<Vec<String>>>Which of the report’s queries this output formats. Default: all of them. Each query runs once, whatever the number of outputs.
when: Option<Loose<OneOf<String, bool>>>A Jinja expression over the results (results.<query>.value < 0); when it’s false, the output is skipped and recorded as skipped.
destination: Option<Loose<OneOf<Destination, Vec<Loose<Destination>>>>>Where to deliver the file: one destination, or a list to deliver to several in one run. Default: the file stays in the target path.
template: Option<Loose<Template>>§for_each: Option<Loose<OneOf<ForEach, bool>>>One copy of the output per row of a driver query ({query: members, key: member_id}), each with its own slice of the results and the driver row as each.*; false turns an inherited one off. See docs/per-row-outputs.md.
file_name: Option<Loose<String>>A per-row output’s file name, with Jinja ("{{ each.member_id }}_statement.pdf"). Default: the row’s key and the format’s extension, under a folder named after the output.
on_empty: Option<Loose<OnEmpty>>When every query of the output returns no rows: continue (default) writes and delivers it empty, with a warning; skip writes and delivers nothing; fail fails the run. A query’s own on_empty wins. See “When there’s no data” in docs/building-reports.md.
extension: Maybe<Loose<Option<OneOf<String, bool>>>>File extension for text formats (e.g. aba), instead of the format’s own. "" or false means none. Not for xlsx.
options: Map<Value>The format’s own options.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Output
impl<'de> Deserialize<'de> for Output
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl JsonSchema for Output
impl JsonSchema for Output
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more