Trait organelle::Soma
[−]
[src]
pub trait Soma: Sized { type Signal: Signal; type Synapse: Synapse; type Error: Error + Send + From<Error> + 'static; fn update(
self,
_msg: Impulse<Self::Signal, Self::Synapse>
) -> Result<Self, Self::Error> { ... } fn into_future(
self,
reactor: Handle
) -> Box<Future<Item = Result<()>, Error = Error>>
where
Self: 'static, { ... } fn run(self) -> Result<()>
where
Self: 'static, { ... } }
defines an interface for a soma of any type
generic across the user-defined message to be passed between somas and the user-defined roles for connections
Associated Types
type Signal: Signal
user-defined message to be passed between somas
type Synapse: Synapse
user-defined roles for connections
type Error: Error + Send + From<Error> + 'static
error when a soma fails to update
Provided Methods
fn update(
self,
_msg: Impulse<Self::Signal, Self::Synapse>
) -> Result<Self, Self::Error>
self,
_msg: Impulse<Self::Signal, Self::Synapse>
) -> Result<Self, Self::Error>
apply any changes to the soma's state as a result of _msg
fn into_future(
self,
reactor: Handle
) -> Box<Future<Item = Result<()>, Error = Error>> where
Self: 'static,
self,
reactor: Handle
) -> Box<Future<Item = Result<()>, Error = Error>> where
Self: 'static,
convert the soma into a future that can be run on an event loop
fn run(self) -> Result<()> where
Self: 'static,
Self: 'static,
spin up an event loop and run soma