pub struct AsterRuntime<S> { /* private fields */ }Expand description
Product-facing runtime runner built from service and component registrations.
Product entrypoints should register the main service as a component, then register database, task, mail, product, or shutdown bundles in the same chain:
ⓘ
AsterRuntime::builder()
.component(http_component(...))
.component(database_component(...))
.component(task_component(...))
.run()
.await?;Implementations§
Source§impl AsterRuntime<()>
impl AsterRuntime<()>
Sourcepub fn builder() -> AsterRuntimeBuilder<()>
pub fn builder() -> AsterRuntimeBuilder<()>
Creates a runtime builder.
Source§impl<S> AsterRuntime<S>where
S: Future,
impl<S> AsterRuntime<S>where
S: Future,
Sourcepub async fn run(self) -> Result<S::Output, AsterRuntimeError>
pub async fn run(self) -> Result<S::Output, AsterRuntimeError>
Runs startup, the main service, before-shutdown hooks, and component shutdown.
When a required startup phase aborts, component shutdown phases still run best-effort before the startup error is returned, so components that already completed startup (connection pools, spawned workers, buffered writers) get a chance to release their resources.
Auto Trait Implementations§
impl<S> Freeze for AsterRuntime<S>where
S: Freeze,
impl<S> !RefUnwindSafe for AsterRuntime<S>
impl<S> Send for AsterRuntime<S>where
S: Send,
impl<S> !Sync for AsterRuntime<S>
impl<S> Unpin for AsterRuntime<S>where
S: Unpin,
impl<S> UnsafeUnpin for AsterRuntime<S>where
S: UnsafeUnpin,
impl<S> !UnwindSafe for AsterRuntime<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