#[non_exhaustive]pub struct ErrorReport {
pub code: ErrorCode,
pub message: String,
pub step: Option<String>,
pub detail: Option<ErrorDetail>,
pub changed: bool,
}Expand description
A failure, as one value: its stable code, its message, the step it happened in, its typed
fields, and whether the run was touched. An embedder branches on ErrorReport::code and
reads ErrorReport::detail’s fields; it never needs the runner’s Error variants.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.code: ErrorCodeThe stable code.
message: StringThe message: plain and technical, secrets masked.
step: Option<String>The step that failed, when one did.
detail: Option<ErrorDetail>The failure’s typed fields, when it has any.
changed: boolWhether the run may have changed: false only when the failure is a refusal made before anything acted on the run (another operation holds it, it is already up or isn’t up, a value it needs is missing or unusable, a tool it needs is missing), so whatever the caller prepared for the operation can be put back. Read as true when absent.
Implementations§
Source§impl ErrorReport
impl ErrorReport
Sourcepub fn new(code: ErrorCode, message: impl Into<String>) -> ErrorReport
pub fn new(code: ErrorCode, message: impl Into<String>) -> ErrorReport
A failure of code saying message, with no step and no fields, that may have changed
the run.
Sourcepub fn with_step(self, step: impl Into<String>) -> ErrorReport
pub fn with_step(self, step: impl Into<String>) -> ErrorReport
The same, failed in step step.
Sourcepub fn with_detail(self, detail: ErrorDetail) -> ErrorReport
pub fn with_detail(self, detail: ErrorDetail) -> ErrorReport
The same, with the typed fields detail.
Sourcepub fn unchanged(self) -> ErrorReport
pub fn unchanged(self) -> ErrorReport
The same, refused before anything acted on the run.
Trait Implementations§
Source§impl Clone for ErrorReport
impl Clone for ErrorReport
Source§impl Debug for ErrorReport
impl Debug for ErrorReport
Source§impl<'de> Deserialize<'de> for ErrorReport
impl<'de> Deserialize<'de> for ErrorReport
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 Display for ErrorReport
impl Display for ErrorReport
impl Eq for ErrorReport
Source§impl JsonSchema for ErrorReport
impl JsonSchema for ErrorReport
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 moreSource§impl PartialEq for ErrorReport
impl PartialEq for ErrorReport
Source§impl Serialize for ErrorReport
impl Serialize for ErrorReport
impl StructuralPartialEq for ErrorReport
Auto Trait Implementations§
impl Forget for ErrorReport
impl Freeze for ErrorReport
impl Move for ErrorReport
impl RefUnwindSafe for ErrorReport
impl Send for ErrorReport
impl Sync for ErrorReport
impl Unpin for ErrorReport
impl UnsafeUnpin for ErrorReport
impl UnwindSafe for ErrorReport
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.