pub struct Runtime(/* private fields */);Expand description
Holds shared state and components used by Rust SDK workers.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new<F>(
options: RuntimeOptions,
tokio_builder: TokioRuntimeBuilder<F>,
) -> Result<Self, Error>
pub fn new<F>( options: RuntimeOptions, tokio_builder: TokioRuntimeBuilder<F>, ) -> Result<Self, Error>
Creates a runtime with a newly constructed Tokio runtime.
Sourcepub fn new_assume_tokio(options: RuntimeOptions) -> Result<Self, Error>
pub fn new_assume_tokio(options: RuntimeOptions) -> Result<Self, Error>
Creates a runtime using the currently active Tokio runtime.
§Panics
Panics if there is no currently active Tokio runtime.
Sourcepub fn new_assume_tokio_initialized_telem(
telemetry: TelemetryInstance,
heartbeat_interval: Option<Duration>,
) -> Self
pub fn new_assume_tokio_initialized_telem( telemetry: TelemetryInstance, heartbeat_interval: Option<Duration>, ) -> Self
Creates a runtime from an initialized telemetry instance using the currently active Tokio runtime.
§Panics
Panics if there is no currently active Tokio runtime.
Methods from Deref<Target = CoreRuntime>§
Sourcepub fn tokio_handle(&self) -> Handle
pub fn tokio_handle(&self) -> Handle
Get a handle to the tokio runtime used by this Core runtime.
Sourcepub fn telemetry(&self) -> &TelemetryInstance
pub fn telemetry(&self) -> &TelemetryInstance
Return a reference to the owned TelemetryInstance
Sourcepub fn telemetry_mut(&mut self) -> &mut TelemetryInstance
pub fn telemetry_mut(&mut self) -> &mut TelemetryInstance
Return a mutable reference to the owned TelemetryInstance
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl !UnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl UnsafeUnpin for Runtime
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<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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request