Skip to main content

PayloadStrategy

Trait PayloadStrategy 

Source
pub trait PayloadStrategy: Send + Sync {
    // Required methods
    fn strategy_ref(&self) -> &PayloadStrategyRef;
    fn derive_one(
        &self,
        role: PayloadVariantRole,
        seed: &PayloadSeed,
        limits: PayloadStrategyLimits,
    ) -> Result<PayloadArtifact, PayloadStrategyError>;
}
Expand description

Pure strategy contract implemented by native capability executors.

Implementations must derive the same bytes for the same reference, role, seed, and limits. They must not read clocks, randomness, knowledge stores, or network state. The registry validates provenance, role, and output size after every call.

Required Methods§

Source

fn strategy_ref(&self) -> &PayloadStrategyRef

Returns the stable strategy identity and implementation revision.

Source

fn derive_one( &self, role: PayloadVariantRole, seed: &PayloadSeed, limits: PayloadStrategyLimits, ) -> Result<PayloadArtifact, PayloadStrategyError>

Derives exactly one bounded artifact for this execution turn.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§