Skip to main content

NodeControl

Trait NodeControl 

Source
pub trait NodeControl {
    // Required methods
    fn stop_component(&mut self) -> Result<(), String>;
    fn stage(&mut self, candidate: &CandidateBytes) -> Result<(), String>;
    fn start_component(&mut self) -> Result<(), StartFailure>;
    fn witness_mailbox(&mut self) -> Result<(), String>;
    fn witness_content(&mut self) -> Result<(), String>;
    fn report(
        &mut self,
        build_generation: u64,
        content_digest: [u8; 32],
    ) -> Result<GenerationReport, String>;
}
Expand description

The node operations the barrier drives, in the only order it drives them. Every method is one observable step; the implementation maps its substrate errors to the step’s typed detail.

Required Methods§

Source

fn stop_component(&mut self) -> Result<(), String>

Ordered stop of the component: drains admitted old work, awaits the tree’s tombstones. After Ok, nothing runs old code.

§Errors

The substrate’s typed stop failure, rendered.

Source

fn stage(&mut self, candidate: &CandidateBytes) -> Result<(), String>

Purges retained old module code and stages these bytes for the next start (the registry staging seam + support-module staging).

§Errors

The typed purge/staging refusal, rendered — a purge refusal is the drain-failure signal.

Source

fn start_component(&mut self) -> Result<(), StartFailure>

Starts the component tree from the staged bytes.

§Errors

StartFailure::Load for byte admission, StartFailure::Tree for a tree that did not come up.

Source

fn witness_mailbox(&mut self) -> Result<(), String>

The mailbox liveness round-trip against the live tree.

§Errors

The witness’s typed failure, rendered.

Source

fn witness_content(&mut self) -> Result<(), String>

The stored-entity/content round-trip against the live tree.

§Errors

The witness’s typed failure, rendered.

Source

fn report( &mut self, build_generation: u64, content_digest: [u8; 32], ) -> Result<GenerationReport, String>

The generation report for what is now serving.

§Errors

A witness that cannot be read — the node is then NOT proven, and the engine reports NodeFailed rather than inventing numbers.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§