lunatic_process::env

Trait Environment

Source
pub trait Environment: Send + Sync {
    // Required methods
    fn id(&self) -> u64;
    fn get_next_process_id(&self) -> u64;
    fn get_process(&self, id: u64) -> Option<Arc<dyn Process>>;
    fn add_process(&self, id: u64, proc: Arc<dyn Process>);
    fn remove_process(&self, id: u64);
    fn process_count(&self) -> usize;
    fn can_spawn_next_process<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<Option<()>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn send(&self, id: u64, signal: Signal);
}

Required Methods§

Source

fn id(&self) -> u64

Source

fn get_next_process_id(&self) -> u64

Source

fn get_process(&self, id: u64) -> Option<Arc<dyn Process>>

Source

fn add_process(&self, id: u64, proc: Arc<dyn Process>)

Source

fn remove_process(&self, id: u64)

Source

fn process_count(&self) -> usize

Source

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

Source

fn send(&self, id: u64, signal: Signal)

Implementors§