Struct organelle::Soma
[−]
[src]
pub struct Soma<M, R> where
M: CellMessage,
R: CellRole, { /* fields omitted */ }
provides core convenience functions with little boilerplate
Methods
impl<M, R> Soma<M, R> where
M: CellMessage,
R: CellRole,
[src]
M: CellMessage,
R: CellRole,
fn new(inputs: Vec<Constraint<R>>, outputs: Vec<Constraint<R>>) -> Result<Self>
[src]
new soma with constraints and default user-defined state
fn update(&mut self, msg: Protocol<M, R>) -> Result<Option<Protocol<M, R>>>
[src]
update the soma's inputs and outputs, then verify constraints
if soma handles the given message, it consumes it, otherwise it is returned so that the cell can use it.
fn effector(&self) -> Result<&Effector<M, R>>
[src]
get the effector assigned to this cell
fn send_req_input(&self, dest: R, msg: M) -> Result<()>
[src]
convenience function for sending messages by role
fn send_req_output(&self, dest: R, msg: M) -> Result<()>
[src]
convenience function for sending messages by role
fn req_input(&self, role: R) -> Result<Handle>
[src]
get a RequireOne input
fn var_input(&self, role: R) -> Result<&Vec<Handle>>
[src]
get a Variadic input
fn req_output(&self, role: R) -> Result<Handle>
[src]
get a RequireOne output
fn var_output(&self, role: R) -> Result<&Vec<Handle>>
[src]
get a Variadic output