pub struct CoreRuntime { /* private fields */ }Expand description
A running runtara-core instance that can be embedded in an application.
The runtime manages:
- HTTP server for instance connections (checkpoints, signals, events)
Call shutdown for graceful termination.
Implementations§
Source§impl CoreRuntime
impl CoreRuntime
Sourcepub fn builder() -> CoreRuntimeBuilder
pub fn builder() -> CoreRuntimeBuilder
Create a new builder for configuring the runtime.
Sourcepub fn bind_addr(&self) -> SocketAddr
pub fn bind_addr(&self) -> SocketAddr
Get the bind address of the HTTP server.
Sourcepub fn state(&self) -> &Arc<InstanceServerState> ⓘ
pub fn state(&self) -> &Arc<InstanceServerState> ⓘ
Get a reference to the shared instance handler state.
This can be used for direct access to persistence or other shared resources.
Sourcepub fn persistence(&self) -> &Arc<dyn Persistence> ⓘ
pub fn persistence(&self) -> &Arc<dyn Persistence> ⓘ
Get a reference to the persistence layer.
Sourcepub async fn shutdown(self) -> Result<()>
pub async fn shutdown(self) -> Result<()>
Gracefully shut down the runtime.
This aborts the HTTP server and waits for it to complete.
Sourcepub fn is_running(&self) -> bool
pub fn is_running(&self) -> bool
Check if the runtime is still running.
Auto Trait Implementations§
impl !RefUnwindSafe for CoreRuntime
impl !UnwindSafe for CoreRuntime
impl Freeze for CoreRuntime
impl Send for CoreRuntime
impl Sync for CoreRuntime
impl Unpin for CoreRuntime
impl UnsafeUnpin for CoreRuntime
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more