Struct organelle::Organelle [] [src]

pub struct Organelle<M, R> where
    M: CellMessage,
    R: CellRole
{ /* fields omitted */ }

a special cell designed to contain a network of interconnected cells

the organelle is created with one cell. this cell is the only cell within the organelle that is allowed to communicate or connect to the outside world. it acts as an entry point for the network, providing essential external data while keeping implementation-specific data and cells hidden. upon receiving an update, it has the opportunity to communicate these updates with external cells.

the intent is to allow organelles to be hierarchical and potentially contain any number of nested cell networks. in order to do this, the organelle isolates a group of messages from the larger whole. this is essential for extensibility and maintainability.

any organelle can be plugged into any other organelle provided their messages and constraints can convert between each other using From and Into

Methods

impl<M, R> Organelle<M, R> where
    M: CellMessage,
    R: CellRole
[src]

[src]

create a new organelle with input and output cells

[src]

add a new cell to the organelle and initialize it

as long as the cell's message type can convert Into and From the organelle's message type, it can be added to the organelle and can communicate with any cells that do the same.

[src]

connect input to output and update them accordingly

[src]

get the main cell's handle

Trait Implementations

impl<M, R> Cell for Organelle<M, R> where
    M: CellMessage,
    R: CellRole
[src]

user-defined message to be passed between cells

user-defined roles for connections

[src]

apply any changes to the cell's state as a result of _msg

[src]

spin up an event loop and run cell