pub struct AsterRuntimeBuilder<S = ()> { /* private fields */ }Expand description
Builder for AsterRuntime.
Implementations§
Source§impl<S> AsterRuntimeBuilder<S>
impl<S> AsterRuntimeBuilder<S>
Sourcepub fn shutdown_token(&self) -> &CancellationToken
pub fn shutdown_token(&self) -> &CancellationToken
Returns the runtime-owned shutdown token.
This accessor is primarily for shared component crates that implement
AsterRuntimeComponent and need to spawn work using the same token the runtime cancels
when the process receives a termination signal.
Sourcepub fn component<C>(self, component: C) -> C::Outputwhere
C: AsterRuntimeComponent<S>,
pub fn component<C>(self, component: C) -> C::Outputwhere
C: AsterRuntimeComponent<S>,
Adds one runtime component.
Sourcepub fn before_shutdown<F, Fut>(self, before_shutdown: F) -> Self
pub fn before_shutdown<F, Fut>(self, before_shutdown: F) -> Self
Registers a product hook that runs after the service future stops and before components.
Sourcepub fn build(self) -> Result<AsterRuntime<S>, AsterRuntimeError>
pub fn build(self) -> Result<AsterRuntime<S>, AsterRuntimeError>
Builds the runtime runner.
Source§impl<S> AsterRuntimeBuilder<S>where
S: Future,
impl<S> AsterRuntimeBuilder<S>where
S: Future,
Sourcepub async fn run(self) -> Result<S::Output, AsterRuntimeError>
pub async fn run(self) -> Result<S::Output, AsterRuntimeError>
Builds and runs the runtime.
Auto Trait Implementations§
impl<S> Freeze for AsterRuntimeBuilder<S>where
S: Freeze,
impl<S = ()> !RefUnwindSafe for AsterRuntimeBuilder<S>
impl<S> Send for AsterRuntimeBuilder<S>where
S: Send,
impl<S = ()> !Sync for AsterRuntimeBuilder<S>
impl<S> Unpin for AsterRuntimeBuilder<S>where
S: Unpin,
impl<S> UnsafeUnpin for AsterRuntimeBuilder<S>where
S: UnsafeUnpin,
impl<S = ()> !UnwindSafe for AsterRuntimeBuilder<S>
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