pub struct ProviderError {
pub error_class: ErrorClass,
pub message: String,
pub wire: Option<Box<ErrorInfo>>,
pub client_code: Option<String>,
pub retryable_source: RetryableSource,
}Expand description
Unified provider-method error carrier: wire fact and normalized conclusion side by side, both recorded in the RunLog (04 §1).
Fields§
§error_class: ErrorClassNormalized conclusion (spine §5 closed enum).
message: StringHuman-readable message.
wire: Option<Box<ErrorInfo>>The daemon’s original { code, message, retryable, details? }, when
the failure carried one (boxed: much larger than the other fields).
client_code: Option<String>Client-side error code (e.g. "transport_closed"; TS reference
implementation @devicerail/client ClientErrorCode — the Rust-side
naming follows the devicerail-client crate when it lands, M1).
retryable_source: RetryableSourceWhere the retryable judgement came from.
Implementations§
Source§impl ProviderError
impl ProviderError
Sourcepub fn new(
error_class: ErrorClass,
message: impl Into<String>,
retryable_source: RetryableSource,
) -> Self
pub fn new( error_class: ErrorClass, message: impl Into<String>, retryable_source: RetryableSource, ) -> Self
Constructs a carrier with neither wire error nor client code.
Sourcepub fn with_client_code(self, client_code: impl Into<String>) -> Self
pub fn with_client_code(self, client_code: impl Into<String>) -> Self
Attaches a client-side error code.
Trait Implementations§
Source§impl Clone for ProviderError
impl Clone for ProviderError
Source§fn clone(&self) -> ProviderError
fn clone(&self) -> ProviderError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl<'de> Deserialize<'de> for ProviderError
impl<'de> Deserialize<'de> for ProviderError
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ProviderError
impl Display for ProviderError
Source§impl Error for ProviderError
impl Error for ProviderError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0:
use the Display impl or to_string()
Source§impl JsonSchema for ProviderError
impl JsonSchema for ProviderError
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for ProviderError
impl PartialEq for ProviderError
Source§impl Serialize for ProviderError
impl Serialize for ProviderError
impl StructuralPartialEq for ProviderError
Auto Trait Implementations§
impl Freeze for ProviderError
impl RefUnwindSafe for ProviderError
impl Send for ProviderError
impl Sync for ProviderError
impl Unpin for ProviderError
impl UnsafeUnpin for ProviderError
impl UnwindSafe for ProviderError
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
Mutably borrows from an owned value. Read more