pub struct Fail {
pub code: Code,
pub message: String,
pub path: Option<String>,
pub limit: Option<Box<Limit>>,
pub row: Option<u64>,
pub column: Option<u64>,
pub file: Option<Box<str>>,
pub committed_output: bool,
}Expand description
A failure: a code, and what is known about where and why.
committed_output says whether bytes had already been written when
the failure was found: an incremental export cannot take them back, and
the caller must be told the output may be partial.
Fields§
§code: Code§message: String§path: Option<String>The input path the failure concerns, in jq syntax, when one applies.
limit: Option<Box<Limit>>Boxed, with the file below, so that a Fail stays small enough
to return by value on every failure path without a warning.
row: Option<u64>1-based source row and column, when the failure has a position.
column: Option<u64>§file: Option<Box<str>>The source file the position is in, when the program the failure came from was compiled from several (a format’s parts linked with a program); absent, the position is the one source’s.
committed_output: boolImplementations§
Source§impl Fail
impl Fail
pub fn new(code: Code, message: impl Into<String>) -> Fail
Sourcepub fn in_file(self, file: impl Into<Box<str>>) -> Fail
pub fn in_file(self, file: impl Into<Box<str>>) -> Fail
The failure with the source file its position is in.
pub fn at_path(self, path: impl Into<String>) -> Fail
pub fn at(self, row: u64, column: u64) -> Fail
pub fn committed(self) -> Fail
Sourcepub fn limit(name: &'static str, value: u64, message: impl Into<String>) -> Fail
pub fn limit(name: &'static str, value: u64, message: impl Into<String>) -> Fail
A limit failure, named after the Limits field that was passed.
pub fn protocol(message: impl Into<String>) -> Fail
pub fn input(message: impl Into<String>) -> Fail
pub fn output(message: impl Into<String>) -> Fail
pub fn aborted() -> Fail
Sourcepub fn from_tabnas(e: &TabnasError) -> Fail
pub fn from_tabnas(e: &TabnasError) -> Fail
The engine’s own error, as an input failure carrying its code,
position and report. With the tabnas feature, which the
language feature turns on.
Trait Implementations§
Source§impl Error for Fail
impl Error for Fail
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()