pub struct Runtime<H> { /* private fields */ }
Expand description
Overclock runtime, spawn the root actor, and server (if enabled)
Implementations
sourceimpl<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
Auto Trait Implementations
impl<H> !RefUnwindSafe for Runtime<H>
impl<H> Send for Runtime<H> where
H: Send,
impl<H> Sync for Runtime<H> where
H: Sync,
impl<H> Unpin for Runtime<H> where
H: Unpin,
impl<H> !UnwindSafe for Runtime<H>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more