Skip to main content

SimulationPlugin

Trait SimulationPlugin 

Source
pub trait SimulationPlugin {
    // Required methods
    fn name(&self) -> &str;
    fn version(&self) -> &str;
    fn semantic_hash(&self) -> &str;
    fn register(
        &self,
        registrar: &mut PluginRegistrar<'_>,
    ) -> Result<(), CanwuError>;

    // Provided method
    fn validate_activation(
        &self,
        _records: &[DomainRecord],
    ) -> Result<(), CanwuError> { ... }
}
Expand description

A stateless executable package whose persisted identity must change whenever its authoritative behavior changes.

Required Methods§

Source

fn name(&self) -> &str

Source

fn version(&self) -> &str

Returns the package or rules release recorded in snapshots.

Source

fn semantic_hash(&self) -> &str

Returns a lowercase 64-character author-controlled semantic hash.

This must change when handler behavior changes even if the serialized registration descriptor remains structurally identical.

Source

fn register( &self, registrar: &mut PluginRegistrar<'_>, ) -> Result<(), CanwuError>

Provided Methods§

Source

fn validate_activation( &self, _records: &[DomainRecord], ) -> Result<(), CanwuError>

Validates plugin-owned records before the plugin becomes executable.

This hook runs after record-schema validation during both initial registration and snapshot rehydration. The kernel supplies only records owned by this plugin; implementations must not mutate external state.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§