#[non_exhaustive]pub struct ProviderError {
pub python_exception: Option<PythonException>,
pub provider: &'static str,
pub detail: Arc<str>,
pub limit: Option<LimitError>,
pub memory: Option<BudgetExceeded>,
pub allocator: Option<AllocError>,
}Expand description
A provider failure.
Construct with ProviderError::new and set optional provenance fields;
the struct may gain fields in future releases.
use unityrs_core::provider::ProviderError;
let error = ProviderError {
provider: "custom", detail: "failure".into(),
limit: None, memory: None, allocator: None,
};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.python_exception: Option<PythonException>Optional Python exception type, message and ancestry from a generator. Only
ValueError and its subclasses are swallowed by MonoBehaviour fallback.
provider: &'static strThe provider’s name.
detail: Arc<str>What failed. Shared, so a clone allocates nothing: a provider keeps each entry’s failure and hands every later request a clone of it.
limit: Option<LimitError>The bound the failure crossed, when it was one (a TPK tree deeper
than crate::limits::Limits::max_tree_depth is
crate::LimitKind::TreeDepth); detail is then its message.
memory: Option<BudgetExceeded>The refusal, when the failure was memory the provider was refused (by
the allocator, or a budget); detail is then its message. It depends
on what else was held at that moment, not on the request, so a
provider never keeps it as the request’s answer (the next ask tries
again), and a reader treats it as the caller’s out-of-memory, never
as a missing tree (the canonical dump’s crash record, the oracle’s
MemoryError).
allocator: Option<AllocError>An allocator refusal, separate from a provider budget refusal. No additional heap storage is needed to preserve its provenance.
Implementations§
Trait Implementations§
Source§impl Clone for ProviderError
impl Clone for ProviderError
Source§impl Debug for ProviderError
impl Debug for ProviderError
Source§impl Display for ProviderError
impl Display for ProviderError
impl Eq 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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()