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(
options: RuntimeOptions,
tokio_builder: TokioRuntimeBuilder,
) -> Result<Self, RuntimeError>
pub fn new( options: RuntimeOptions, tokio_builder: TokioRuntimeBuilder, ) -> Result<Self, RuntimeError>
Creates a runtime with a newly constructed Tokio runtime.
§Errors
Returns an error if telemetry or the Tokio runtime cannot be initialized.
Sourcepub fn from_current_tokio(options: RuntimeOptions) -> Result<Self, RuntimeError>
pub fn from_current_tokio(options: RuntimeOptions) -> Result<Self, RuntimeError>
Creates a runtime using the currently active Tokio runtime.
§Errors
Returns RuntimeError::NoCurrentTokioRuntime if there is no currently active Tokio
runtime, or RuntimeError::Initialization if telemetry cannot be initialized.
Sourcepub fn new_assume_tokio(options: RuntimeOptions) -> Result<Self, RuntimeError>
👎Deprecated: use Runtime::from_current_tokio instead
pub fn new_assume_tokio(options: RuntimeOptions) -> Result<Self, RuntimeError>
use Runtime::from_current_tokio instead
Creates a runtime using the currently active Tokio runtime.
§Errors
Returns RuntimeError::NoCurrentTokioRuntime if there is no currently active Tokio
runtime, or RuntimeError::Initialization if telemetry cannot be initialized.
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