pub trait ModuleConstructor: Send + Sync {
// Required methods
fn type_name(&self) -> &'static str;
fn construct(
&self,
module: &ModuleDef,
automaton_defs: &[AutomatonDef],
system: &Arc<ActorSystem>,
graph_ref: &ActorRef<CommandEnum>,
) -> Result<ActorRef<CommandEnum>, ModuleError>;
fn clone_box(&self) -> Box<dyn ModuleConstructor>;
}Expand description
Constructs rack modules from a ModuleDef descriptor.
Each constructor receives the full module descriptor plus the list of
automaton definitions needed by Servo modules. Custom and registered
constructors return an ActorRef<CommandEnum> that the rack actor
uses for fan-out.
Required Methods§
Sourcefn construct(
&self,
module: &ModuleDef,
automaton_defs: &[AutomatonDef],
system: &Arc<ActorSystem>,
graph_ref: &ActorRef<CommandEnum>,
) -> Result<ActorRef<CommandEnum>, ModuleError>
fn construct( &self, module: &ModuleDef, automaton_defs: &[AutomatonDef], system: &Arc<ActorSystem>, graph_ref: &ActorRef<CommandEnum>, ) -> Result<ActorRef<CommandEnum>, ModuleError>
Build the module and return its actor handle.
automaton_defs provides the automaton definitions referenced
by ModuleDef::Servo. Other module types ignore this parameter.
Sourcefn clone_box(&self) -> Box<dyn ModuleConstructor>
fn clone_box(&self) -> Box<dyn ModuleConstructor>
Returns a heap-allocated clone of this constructor.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".