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. An enabled environment config or
an explicitly supplied dial9 config owns its 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. An enabled environment config or
an explicitly supplied dial9 config owns its 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. An enabled environment config or
an explicitly supplied dial9 config owns its scheduler and conflicts
with this setting.
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. An enabled environment config or
an explicitly supplied dial9 config owns its scheduler and conflicts
with this setting.
pub fn maybe_with_dial9_config(
self,
dial9_config: Option<Dial9Config>,
) -> RuntimeBuilder
pub fn maybe_with_dial9_config( self, dial9_config: Option<Dial9Config>, ) -> RuntimeBuilder
Set the dial9 runtime configuration.
With the dial9 feature, this defaults to resolving
Dial9Config::from_env when the runtime is built. An enabled
dial9 config owns its Tokio scheduler configuration. Combining an
explicitly supplied config with
with_current_thread or
with_worker_threads is rejected by
try_build. An implicit environment config yields
to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_config to explicitly
select a Rama-configured scheduler without dial9.
An enabled config must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn maybe_set_dial9_config(
&mut self,
dial9_config: Option<Dial9Config>,
) -> &mut RuntimeBuilder
pub fn maybe_set_dial9_config( &mut self, dial9_config: Option<Dial9Config>, ) -> &mut RuntimeBuilder
Set the dial9 runtime configuration.
With the dial9 feature, this defaults to resolving
Dial9Config::from_env when the runtime is built. An enabled
dial9 config owns its Tokio scheduler configuration. Combining an
explicitly supplied config with
with_current_thread or
with_worker_threads is rejected by
try_build. An implicit environment config yields
to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_config to explicitly
select a Rama-configured scheduler without dial9.
An enabled config must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn with_dial9_config(self, dial9_config: Dial9Config) -> RuntimeBuilder
pub fn with_dial9_config(self, dial9_config: Dial9Config) -> RuntimeBuilder
Set the dial9 runtime configuration.
With the dial9 feature, this defaults to resolving
Dial9Config::from_env when the runtime is built. An enabled
dial9 config owns its Tokio scheduler configuration. Combining an
explicitly supplied config with
with_current_thread or
with_worker_threads is rejected by
try_build. An implicit environment config yields
to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_config to explicitly
select a Rama-configured scheduler without dial9.
An enabled config must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn set_dial9_config(
&mut self,
dial9_config: Dial9Config,
) -> &mut RuntimeBuilder
pub fn set_dial9_config( &mut self, dial9_config: Dial9Config, ) -> &mut RuntimeBuilder
Set the dial9 runtime configuration.
With the dial9 feature, this defaults to resolving
Dial9Config::from_env when the runtime is built. An enabled
dial9 config owns its Tokio scheduler configuration. Combining an
explicitly supplied config with
with_current_thread or
with_worker_threads is rejected by
try_build. An implicit environment config yields
to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_config to explicitly
select a Rama-configured scheduler without dial9.
An enabled config must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn without_dial9_config(self) -> RuntimeBuilder
pub fn without_dial9_config(self) -> RuntimeBuilder
Set the dial9 runtime configuration.
With the dial9 feature, this defaults to resolving
Dial9Config::from_env when the runtime is built. An enabled
dial9 config owns its Tokio scheduler configuration. Combining an
explicitly supplied config with
with_current_thread or
with_worker_threads is rejected by
try_build. An implicit environment config yields
to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_config to explicitly
select a Rama-configured scheduler without dial9.
An enabled config must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
pub fn unset_dial9_config(&mut self) -> &mut RuntimeBuilder
pub fn unset_dial9_config(&mut self) -> &mut RuntimeBuilder
Set the dial9 runtime configuration.
With the dial9 feature, this defaults to resolving
Dial9Config::from_env when the runtime is built. An enabled
dial9 config owns its Tokio scheduler configuration. Combining an
explicitly supplied config with
with_current_thread or
with_worker_threads is rejected by
try_build. An implicit environment config yields
to an explicit Rama scheduler when telemetry is disabled. Use
without_dial9_config to explicitly
select a Rama-configured scheduler without dial9.
An enabled config must produce a multi-thread runtime because dial9 installs ambient telemetry handles on Tokio-owned worker threads.
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 !Sync for RuntimeBuilder
impl !UnwindSafe for RuntimeBuilder
impl Freeze for RuntimeBuilder
impl Send 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