#[non_exhaustive]pub enum ResourceValidationError {
MissingResource {
node: NodeId,
system_name: &'static str,
resource_type: &'static str,
type_id: TypeId,
access_mode: AccessMode,
},
MissingOutput {
node: NodeId,
system_name: &'static str,
output_type: &'static str,
type_id: TypeId,
},
ScopeMissingFactory {
scope: NodeId,
scope_name: &'static str,
resource: &'static str,
},
ScopeMissingResource {
scope: NodeId,
scope_name: &'static str,
resource: &'static str,
action: &'static str,
},
}Expand description
Errors that can occur during resource validation.
These errors are detected before graph execution starts, allowing early detection of missing resources that would cause runtime failures.
§Examples
use polaris_graph::ResourceValidationError;
use polaris_graph::NodeId;
use polaris_system::param::AccessMode;
use std::any::TypeId;
let err = ResourceValidationError::MissingResource {
node: NodeId::from_string("node_1"),
system_name: "my_system",
resource_type: "MyConfig",
type_id: TypeId::of::<String>(),
access_mode: AccessMode::Read,
};
// Display provides a human-readable message
let msg = format!("{err}");
assert!(msg.contains("my_system"));
assert!(msg.contains("MyConfig"));Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingResource
A required resource is missing from the context.
Fields
access_mode: AccessModeThe access mode (read or write).
MissingOutput
A required output from a previous system is missing.
Fields
ScopeMissingFactory
A scope’s ContextPolicy declared forward_fresh::<T>() for a resource
that has no registered factory in the parent context or globals.
Detected during GraphExecutor::validate_resources by walking the
parent chain via SystemContext::factory_fn_by_type_id.
Fields
ScopeMissingResource
A scope’s ContextPolicy declared a per-resource crossing
(forward::<T>() or fork::<T>()) for a resource that is not
reachable from the parent context at validation time.
Detected during GraphExecutor::validate_resources via
SystemContext::contains_resource_by_type_id. Mirrors the runtime
ExecutionError::ScopeMissingResource safety net for callers that
skip validation.
Trait Implementations§
Source§impl Clone for ResourceValidationError
impl Clone for ResourceValidationError
Source§fn clone(&self) -> ResourceValidationError
fn clone(&self) -> ResourceValidationError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ResourceValidationError
impl Debug for ResourceValidationError
Source§impl Display for ResourceValidationError
impl Display for ResourceValidationError
Source§impl Error for ResourceValidationError
impl Error for ResourceValidationError
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()