Trait ReactorInitializer

Source
pub trait ReactorInitializer: ReactorBehavior {
    type Wrapped;
    type Params;

    const MAX_REACTION_ID: LocalReactionId;

    // Required method
    fn assemble(
        args: Self::Params,
        assembler: AssemblyCtx<'_, Self>,
    ) -> AssemblyResult<FinishedReactor<'_, Self>>
       where Self: Sized;
}
Expand description

Wrapper around the user struct for safe dispatch.

Fields are

  1. the user struct,
  2. ctor parameters of the reactor, and
  3. every logical action and port declared by the reactor.

Required Associated Constants§

Source

const MAX_REACTION_ID: LocalReactionId

Exclusive maximum value of the local_rid parameter of [ReactorBehavior.react].

Required Associated Types§

Source

type Wrapped

Type of the user struct, which contains state variables of the reactor. Used by the runtime to produce debug information.

Source

type Params

Type of the construction parameters.

Required Methods§

Source

fn assemble( args: Self::Params, assembler: AssemblyCtx<'_, Self>, ) -> AssemblyResult<FinishedReactor<'_, Self>>
where Self: Sized,

Assemble this reactor. This initializes state variables, produces internal components, assembles children reactor instances, and declares dependencies between them.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§