pub trait Runtime:
Sized
+ Send
+ 'static {
type Context: Context;
// Required methods
fn get_interruptor(&mut self) -> Box<dyn Interruptor>;
fn routine<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = Failures> + Send + 'async_trait>>
where Self: 'async_trait;
fn context(&self) -> &Self::Context;
// Provided method
fn entrypoint<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait { ... }
}
Expand description
A runtime that can be executed by a supervisor.
Required Associated Types§
Required Methods§
Sourcefn get_interruptor(&mut self) -> Box<dyn Interruptor>
fn get_interruptor(&mut self) -> Box<dyn Interruptor>
Used by a lifetime tracker of the supervisor to stop it. It’s the separate type that wraps address made by a runtime.
Provided Methods§
fn entrypoint<'async_trait>(
self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.