pub struct FormatOutput {
pub content: String,
pub had_errors: bool,
pub error_messages: Vec<String>,
pub failures: Vec<CodeBlockDiagnostic>,
}Expand description
Result of formatting code blocks in a document.
Fields§
§content: StringThe formatted content (may be partially formatted if errors occurred).
had_errors: boolWhether any messages were collected. Warn-level messages count too.
error_messages: Vec<String>Error messages for blocks that couldn’t be formatted, in the prose form
the terminal shows. Both levels appear here: a message collected under
on-error = "warn" is for the reader and nothing more.
failures: Vec<CodeBlockDiagnostic>The fail-level subset of the above, as diagnostics rather than prose.
A tool could not run under a setting of fail, so the document was only
partly formatted and the run must not be reported as clean. The lint path
records the same fact as a diagnostic and every output format carries it;
these exist so a format run says it in the same machine-readable place
instead of only in a line of stderr. Messages collected under
on-error = "warn" are not failures and are not here.