pub struct Runtime<H> { /* private fields */ }
Expand description
Overclock runtime, spawn the root actor, and server (if enabled)
Implementations§
source§impl<H> Runtime<H>where
H: Clone + Shutdown,
impl<H> Runtime<H>where
H: Clone + Shutdown,
sourcepub async fn new<T, A>(root_dir: T, child: A) -> ActorResult<Self>where
A: 'static + ChannelBuilder<<A as Actor<NullSupervisor>>::Channel> + Actor<NullSupervisor>,
T: Into<Option<String>>,
<A as Actor<NullSupervisor>>::Channel: Channel<Handle = H>,
H: Shutdown + Clone,
pub async fn new<T, A>(root_dir: T, child: A) -> ActorResult<Self>where
A: 'static + ChannelBuilder<<A as Actor<NullSupervisor>>::Channel> + Actor<NullSupervisor>,
T: Into<Option<String>>,
<A as Actor<NullSupervisor>>::Channel: Channel<Handle = H>,
H: Shutdown + Clone,
Create and spawn runtime with null supervisor handle
sourcepub async fn with_supervisor<T, A, S>(
dir: T,
child: A,
supervisor: S
) -> ActorResult<Self>where
A: 'static + ChannelBuilder<<A as Actor<S>>::Channel> + Actor<S>,
T: Into<Option<String>>,
<A as Actor<S>>::Channel: Channel<Handle = H>,
S: SupHandle<A>,
H: Shutdown + Clone,
pub async fn with_supervisor<T, A, S>(
dir: T,
child: A,
supervisor: S
) -> ActorResult<Self>where
A: 'static + ChannelBuilder<<A as Actor<S>>::Channel> + Actor<S>,
T: Into<Option<String>>,
<A as Actor<S>>::Channel: Channel<Handle = H>,
S: SupHandle<A>,
H: Shutdown + Clone,
Create new runtime with provided supervisor handle
sourcepub fn handle_mut(&mut self) -> &mut H
pub fn handle_mut(&mut self) -> &mut H
Returns mutable reference to the root actor
sourcepub async fn block_on(self) -> ActorResult<()>
pub async fn block_on(self) -> ActorResult<()>
Block on the runtime till it shutdown gracefully