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
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§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<E, T, const C: usize> ChannelBuilder<AbortableBoundedChannel<E, C>> for Twhere
E: Send + 'static,
T: Send,
impl<E, T, const C: usize> ChannelBuilder<AbortableBoundedChannel<E, C>> for Twhere E: Send + 'static, T: Send,
source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<AbortableBoundedChannel<E, C>, ActorError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<AbortableBoundedChannel<E, C>, ActorError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,
Implement how to build the channel for the corresponding actor
source§impl<E, T> ChannelBuilder<AbortableUnboundedChannel<E>> for Twhere
E: Send + 'static,
T: Send,
impl<E, T> ChannelBuilder<AbortableUnboundedChannel<E>> for Twhere E: Send + 'static, T: Send,
source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<AbortableUnboundedChannel<E>, ActorError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<AbortableUnboundedChannel<E>, ActorError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,
Implement how to build the channel for the corresponding actor
source§impl<E, T, const C: usize> ChannelBuilder<BoundedChannel<E, C>> for Twhere
E: ShutdownEvent + 'static,
T: Send,
impl<E, T, const C: usize> ChannelBuilder<BoundedChannel<E, C>> for Twhere E: ShutdownEvent + 'static, T: Send,
source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<BoundedChannel<E, C>, ActorError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<BoundedChannel<E, C>, ActorError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,
Implement how to build the channel for the corresponding actor
source§impl<T, const I: u64> ChannelBuilder<IntervalChannel<I>> for Twhere
T: Send,
impl<T, const I: u64> ChannelBuilder<IntervalChannel<I>> for Twhere T: Send,
source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<IntervalChannel<I>, ActorError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<IntervalChannel<I>, ActorError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,
Implement how to build the channel for the corresponding actor
source§impl<T, C, B> ChannelBuilder<Marker<C, B>> for Twhere
B: Send + 'static + Sync,
T: Send + ChannelBuilder<C>,
C: Channel,
impl<T, C, B> ChannelBuilder<Marker<C, B>> for Twhere B: Send + 'static + Sync, T: Send + ChannelBuilder<C>, C: Channel,
source§impl<T> ChannelBuilder<NullChannel> for Twhere
T: Send,
impl<T> ChannelBuilder<NullChannel> for Twhere T: Send,
source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<NullChannel, ActorError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<NullChannel, ActorError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,
Implement how to build the channel for the corresponding actor
source§impl<E, T> ChannelBuilder<UnboundedChannel<E>> for Twhere
E: ShutdownEvent + 'static,
T: Send,
impl<E, T> ChannelBuilder<UnboundedChannel<E>> for Twhere E: ShutdownEvent + 'static, T: Send,
source§fn build_channel<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<UnboundedChannel<E>, ActorError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
T: 'async_trait,
fn build_channel<'life0, 'async_trait>( &'life0 mut self ) -> Pin<Box<dyn Future<Output = Result<UnboundedChannel<E>, ActorError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, T: 'async_trait,
Implement how to build the channel for the corresponding actor