pub struct FallibleConversion {
pub path: Path,
pub escape: Option<Path>,
}Expand description
A crossing that can FAIL, and how its error reaches the record’s own.
§The escape, and why the default is not one
A fallible leg is emitted as f(value)?, and the ? is what asks the record’s error to absorb
whatever f reports — From, which core’s own blanket already supplies for the boxed default.
Where that From cannot exist the ? is E0277 naming the offending function’s error, which is
a better sentence than any wrapper this emitter could write, and it is the compiler’s.
escape is the way out for the cases where the bound genuinely cannot hold: two
FOREIGN types either side of the impl (the orphan rule, which the comparison layer’s own crossing
already documents), an error a caller wants to WRAP with context rather than absorb, and a
function whose error is not an Error at all. It is fn(FnErr) -> RecordErr, applied at the
crossing, so a signature that does not line up is E0308 at the call.
Fields§
§path: PathThe declared function.
escape: Option<Path>try_from_with = "…" / try_into_with = "…" — the map from this function’s error into the
record’s, where From is unavailable. None is the plain ?.