Struct RuntimeBuilder
pub struct RuntimeBuilder { /* private fields */ }std only.Expand description
Builder for a dedicated blocking-boundary Runtime.
Implementations§
§impl RuntimeBuilder
impl RuntimeBuilder
pub fn new() -> RuntimeBuilder
pub fn new() -> RuntimeBuilder
Create a runtime builder with default settings.
pub fn with_thread_name(self, name: impl Into<String>) -> RuntimeBuilder
pub fn with_thread_name(self, name: impl Into<String>) -> RuntimeBuilder
Set the name of the dedicated runtime owner thread.
pub fn set_thread_name(
&mut self,
name: impl Into<String>,
) -> &mut RuntimeBuilder
pub fn set_thread_name( &mut self, name: impl Into<String>, ) -> &mut RuntimeBuilder
Set the name of the dedicated runtime owner thread.
pub fn with_shutdown_timeout(self, timeout: Duration) -> RuntimeBuilder
pub fn with_shutdown_timeout(self, timeout: Duration) -> RuntimeBuilder
Set the maximum time spent shutting down Tokio work when the final runtime lease is dropped.
pub fn set_shutdown_timeout(&mut self, timeout: Duration) -> &mut RuntimeBuilder
pub fn set_shutdown_timeout(&mut self, timeout: Duration) -> &mut RuntimeBuilder
Set the maximum time spent shutting down Tokio work when the final runtime lease is dropped.
pub fn with_current_thread(self) -> RuntimeBuilder
pub fn with_current_thread(self) -> RuntimeBuilder
Use a current-thread Tokio scheduler.
With the dial9 feature, this overrides the implicit environment
config when telemetry is disabled. Enabled telemetry needs the
multi-thread scheduler and conflicts with this setting.
pub fn set_current_thread(&mut self) -> &mut RuntimeBuilder
pub fn set_current_thread(&mut self) -> &mut RuntimeBuilder
Use a current-thread Tokio scheduler.
With the dial9 feature, this overrides the implicit environment
config when telemetry is disabled. Enabled telemetry needs the
multi-thread scheduler and conflicts with this setting.
pub fn with_worker_threads(self, worker_threads: usize) -> RuntimeBuilder
pub fn with_worker_threads(self, worker_threads: usize) -> RuntimeBuilder
Use a multi-thread Tokio scheduler.
With the dial9 feature, this overrides the implicit environment
config when telemetry is disabled, and its worker count applies to
the instrumented runtime otherwise.
pub fn set_worker_threads(
&mut self,
worker_threads: usize,
) -> &mut RuntimeBuilder
pub fn set_worker_threads( &mut self, worker_threads: usize, ) -> &mut RuntimeBuilder
Use a multi-thread Tokio scheduler.
With the dial9 feature, this overrides the implicit environment
config when telemetry is disabled, and its worker count applies to
the instrumented runtime otherwise.
pub fn maybe_with_dial9_recorder(
self,
dial9_recorder: Option<Recorder>,
) -> RuntimeBuilder
pub fn maybe_with_dial9_recorder( self, dial9_recorder: Option<Recorder>, ) -> RuntimeBuilder
Set the Recorder this runtime records into.
With the dial9 feature, this defaults to resolving the DIAL9_*
environment when the runtime is built. Combining an enabled recorder
with with_current_thread is rejected
by try_build. An implicit environment config
yields to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_recorder to
explicitly select a Rama-configured scheduler without dial9.
An enabled recorder must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn maybe_set_dial9_recorder(
&mut self,
dial9_recorder: Option<Recorder>,
) -> &mut RuntimeBuilder
pub fn maybe_set_dial9_recorder( &mut self, dial9_recorder: Option<Recorder>, ) -> &mut RuntimeBuilder
Set the Recorder this runtime records into.
With the dial9 feature, this defaults to resolving the DIAL9_*
environment when the runtime is built. Combining an enabled recorder
with with_current_thread is rejected
by try_build. An implicit environment config
yields to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_recorder to
explicitly select a Rama-configured scheduler without dial9.
An enabled recorder must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn with_dial9_recorder(self, dial9_recorder: Recorder) -> RuntimeBuilder
pub fn with_dial9_recorder(self, dial9_recorder: Recorder) -> RuntimeBuilder
Set the Recorder this runtime records into.
With the dial9 feature, this defaults to resolving the DIAL9_*
environment when the runtime is built. Combining an enabled recorder
with with_current_thread is rejected
by try_build. An implicit environment config
yields to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_recorder to
explicitly select a Rama-configured scheduler without dial9.
An enabled recorder must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn set_dial9_recorder(
&mut self,
dial9_recorder: Recorder,
) -> &mut RuntimeBuilder
pub fn set_dial9_recorder( &mut self, dial9_recorder: Recorder, ) -> &mut RuntimeBuilder
Set the Recorder this runtime records into.
With the dial9 feature, this defaults to resolving the DIAL9_*
environment when the runtime is built. Combining an enabled recorder
with with_current_thread is rejected
by try_build. An implicit environment config
yields to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_recorder to
explicitly select a Rama-configured scheduler without dial9.
An enabled recorder must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn without_dial9_recorder(self) -> RuntimeBuilder
pub fn without_dial9_recorder(self) -> RuntimeBuilder
Set the Recorder this runtime records into.
With the dial9 feature, this defaults to resolving the DIAL9_*
environment when the runtime is built. Combining an enabled recorder
with with_current_thread is rejected
by try_build. An implicit environment config
yields to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_recorder to
explicitly select a Rama-configured scheduler without dial9.
An enabled recorder must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn unset_dial9_recorder(&mut self) -> &mut RuntimeBuilder
pub fn unset_dial9_recorder(&mut self) -> &mut RuntimeBuilder
Set the Recorder this runtime records into.
With the dial9 feature, this defaults to resolving the DIAL9_*
environment when the runtime is built. Combining an enabled recorder
with with_current_thread is rejected
by try_build. An implicit environment config
yields to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_recorder to
explicitly select a Rama-configured scheduler without dial9.
An enabled recorder must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn with_dial9_attach_options(
self,
dial9_attach_options: TokioAttachOptions,
) -> RuntimeBuilder
pub fn with_dial9_attach_options( self, dial9_attach_options: TokioAttachOptions, ) -> RuntimeBuilder
Set how this runtime is traced: task tracking, dumps, hooks, and its name in the trace.
Applies alongside with_dial9_recorder.
The implicit environment path configures itself from DIAL9_*, so
combining options with it is rejected by
try_build; with telemetry explicitly disabled
the options are moot.
When unset, the runtime takes this builder’s thread name. Set options
and you name it yourself.
pub fn set_dial9_attach_options(
&mut self,
dial9_attach_options: TokioAttachOptions,
) -> &mut RuntimeBuilder
pub fn set_dial9_attach_options( &mut self, dial9_attach_options: TokioAttachOptions, ) -> &mut RuntimeBuilder
Set how this runtime is traced: task tracking, dumps, hooks, and its name in the trace.
Applies alongside with_dial9_recorder.
The implicit environment path configures itself from DIAL9_*, so
combining options with it is rejected by
try_build; with telemetry explicitly disabled
the options are moot.
When unset, the runtime takes this builder’s thread name. Set options
and you name it yourself.
Trait Implementations§
§impl Debug for RuntimeBuilder
impl Debug for RuntimeBuilder
§impl Default for RuntimeBuilder
impl Default for RuntimeBuilder
§fn default() -> RuntimeBuilder
fn default() -> RuntimeBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeBuilder
impl !UnwindSafe for RuntimeBuilder
impl Freeze for RuntimeBuilder
impl Send for RuntimeBuilder
impl Sync for RuntimeBuilder
impl Unpin for RuntimeBuilder
impl UnsafeUnpin for RuntimeBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more