pub trait ComponentValidator: Send + Sync {
// Required method
fn validate(
&self,
req: ValidateComponentRequest,
) -> Result<(), CapabilityError>;
}Expand description
Checks a Wasm component’s manifest and real bytes before its route is registered. A real implementor enforces two gates, per ADR-001:
- Manifest-level grant check — every capability
req.manifest.capabilitiesdeclares must appear inreq.granted_capabilities(deny-by-default), and each grant’sCapabilityScopemust be non-trivially empty for its kind. - Structural import check —
req.component_bytes’ actual component-level imports must each be backed by either a granted capability with a real host implementation, or an unconditional base-ABI runtime-support import.
Zero implementation here — this port only declares the contract.
Required Methods§
Sourcefn validate(&self, req: ValidateComponentRequest) -> Result<(), CapabilityError>
fn validate(&self, req: ValidateComponentRequest) -> Result<(), CapabilityError>
Validate req, per the two-gate contract above.
§Errors
Returns CapabilityError naming which gate failed and why.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".