pub struct Failure { /* private fields */ }Expand description
Why one command failed.
Every member is always written, source and retry_after_seconds as null when they
have nothing to say, so a caller reads a fixed shape.
Implementations§
Source§impl Failure
What a linking caller reads.
impl Failure
What a linking caller reads.
The same members the failure document writes, through Failure::class,
Failure::kind, Failure::source, Failure::message and
Failure::retry_after_seconds, so a Rust caller never serialises a failure to branch on
it. They read and nothing more: no caller can build or alter a failure whose class
disagrees with classify.
Sourcepub fn decided(kind: &str, message: impl Into<String>) -> Self
pub fn decided(kind: &str, message: impl Into<String>) -> Self
A failure this product decided on its own, with no source behind it.
Sourcepub fn class(&self) -> FailureClass
pub fn class(&self) -> FailureClass
Whether repeating the request unchanged could change the answer — the one closed
value a caller branches on, as classify decided it for this failure’s cause.
Sourcepub fn kind(&self) -> &str
pub fn kind(&self) -> &str
What failed: the causing source error’s own kind when a source caused it, and
otherwise this product’s kebab-case name for the failure, such as no-such-item.
Sourcepub fn source(&self) -> Option<&SourceName>
pub fn source(&self) -> Option<&SourceName>
The configured source the failure came from, or None when none did.
Sourcepub fn retry_after_seconds(&self) -> Option<u64>
pub fn retry_after_seconds(&self) -> Option<u64>
How many seconds a rate limit asked the caller to wait, or None when it named no
wait.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Failure
impl<'de> Deserialize<'de> for Failure
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 From<&ConfigError> for Failure
impl From<&ConfigError> for Failure
Source§fn from(error: &ConfigError) -> Self
fn from(error: &ConfigError) -> Self
A configuration this product will not run on. No source caused it — a plugin refusing its own block is refused here, at load, before any source is built.
Source§impl From<&EngineError> for Failure
impl From<&EngineError> for Failure
Source§fn from(error: &EngineError) -> Self
fn from(error: &EngineError) -> Self
Source§impl JsonSchema for Failure
impl JsonSchema for Failure
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