mm1_core/context/
start.rs

1use std::time::Duration;
2
3use mm1_address::address::Address;
4use mm1_common::errors::error_of::ErrorOf;
5use mm1_proto_system::{SpawnErrorKind, StartErrorKind};
6
7pub trait Start<Runnable> {
8    fn spawn(
9        &mut self,
10        runnable: Runnable,
11        link: bool,
12    ) -> impl Future<Output = Result<Address, ErrorOf<SpawnErrorKind>>> + Send;
13
14    fn start(
15        &mut self,
16        runnable: Runnable,
17        link: bool,
18        start_timeout: Duration,
19    ) -> impl Future<Output = Result<Address, ErrorOf<StartErrorKind>>> + Send;
20}
21
22pub trait InitDone {
23    fn init_done(&mut self, address: Address) -> impl Future<Output = ()> + Send;
24}