pub trait AutomatonConstructor: Send + Sync {
// Required methods
fn type_name(&self) -> &'static str;
fn construct(
&self,
id: &str,
params: &Params,
target: &ServoTarget,
) -> BoxedModule;
fn clone_box(&self) -> Box<dyn AutomatonConstructor>;
// Provided method
fn spawn_async(
&self,
_id: &str,
_params: &Params,
_target: &ServoTarget,
_interval_ms: f64,
_command_queue: ActorRef<CommandEnum>,
) -> Option<JoinHandle<()>> { ... }
}Expand description
Constructs automaton modules from type name, params, and target.
Required Methods§
Sourcefn construct(
&self,
id: &str,
params: &Params,
target: &ServoTarget,
) -> BoxedModule
fn construct( &self, id: &str, params: &Params, target: &ServoTarget, ) -> BoxedModule
Builds a boxed module from the given id, params, and servo target.
Sourcefn clone_box(&self) -> Box<dyn AutomatonConstructor>
fn clone_box(&self) -> Box<dyn AutomatonConstructor>
Returns a heap-allocated clone of this constructor.
Provided Methods§
Sourcefn spawn_async(
&self,
_id: &str,
_params: &Params,
_target: &ServoTarget,
_interval_ms: f64,
_command_queue: ActorRef<CommandEnum>,
) -> Option<JoinHandle<()>>
fn spawn_async( &self, _id: &str, _params: &Params, _target: &ServoTarget, _interval_ms: f64, _command_queue: ActorRef<CommandEnum>, ) -> Option<JoinHandle<()>>
Optionally spawns an async green-thread for automata that run independently of the graph clock.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".