Module

Trait Module 

Source
pub trait Module {
    type InputMessage;
    type OutputMessage;
    type ModulePrivateInterface: ModulePrivateInterface<Self::InputMessage, Self::OutputMessage>;

    // Provided method
    fn prepare_interfaces(
        cap: usize,
    ) -> (ModuleInterface<Self::InputMessage, Self::OutputMessage>, Self::ModulePrivateInterface) { ... }
}
Expand description

Define an agent module. Each module can receive message as inputs and send via its outputs. All the messages are broadcasted. Each module has a single thread used for handling the messages. If longer computation are needed, they can spawn other modules.

Required Associated Types§

Source

type InputMessage

Type of the input message for this module

Source

type OutputMessage

Type of the output message for this module

Source

type ModulePrivateInterface: ModulePrivateInterface<Self::InputMessage, Self::OutputMessage>

Type of the private interface

Provided Methods§

Source

fn prepare_interfaces( cap: usize, ) -> (ModuleInterface<Self::InputMessage, Self::OutputMessage>, Self::ModulePrivateInterface)

This function is called ahead

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§