Trait Process

Source
pub trait Process<W, A>{
    // Required methods
    fn init(
        &mut self,
        args: Vec<String>,
        net: ProcNet<W, A>,
        id: Id,
        ids: Vec<Id>,
        start_msg_id: MsgId,
    );
    fn run<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Status> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Maelstrom node process

A process receives, processes and, if necessary, responds to

Parameters

  • W the workload body type, e.g. Echo
  • A the application body type

Required Methods§

Source

fn init( &mut self, args: Vec<String>, net: ProcNet<W, A>, id: Id, ids: Vec<Id>, start_msg_id: MsgId, )

Create a process

  • args pass through command line args
  • net a network interface to Maelstrom
  • id this node’s ID
  • ids all protocol participants’ IDs
  • start_msg_id the first message ID to use. Initialization messages are handled by the runtime, so this may be greater than 0.
Source

fn run<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Status> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Run the process

The call should return when the process is complete or the runtime has shutdown.

Return

Implementors§