pub struct Builder {
runtime_name: String,
thread_name: String,
priority: Priority,
builder: Builder,
}
Fields§
§runtime_name: String
§thread_name: String
§priority: Priority
§builder: Builder
Implementations§
source§impl Builder
impl Builder
pub fn priority(&mut self, priority: Priority) -> &mut Self
sourcepub fn worker_threads(&mut self, val: usize) -> &mut Self
pub fn worker_threads(&mut self, val: usize) -> &mut Self
Sets the number of worker threads the Runtime will use.
This can be any number above 0. The default value is the number of cores available to the system.
sourcepub fn max_blocking_threads(&mut self, val: usize) -> &mut Self
pub fn max_blocking_threads(&mut self, val: usize) -> &mut Self
Specifies the limit for additional threads spawned by the Runtime.
These threads are used for blocking operations like tasks spawned through spawn_blocking, they are not always active and will exit if left idle for too long, You can change this timeout duration with thread_keep_alive. The default value is 512.
sourcepub fn thread_keep_alive(&mut self, duration: Duration) -> &mut Self
pub fn thread_keep_alive(&mut self, duration: Duration) -> &mut Self
Sets a custom timeout for a thread in the blocking pool.
By default, the timeout for a thread is set to 10 seconds.
pub fn runtime_name(&mut self, val: impl Into<String>) -> &mut Self
sourcepub fn thread_name(&mut self, val: impl Into<String>) -> &mut Self
pub fn thread_name(&mut self, val: impl Into<String>) -> &mut Self
Sets name of threads spawned by the Runtime thread pool
Trait Implementations§
source§impl BuilderBuild<DefaultRuntime> for Builder
impl BuilderBuild<DefaultRuntime> for Builder
fn build(&mut self) -> Result<DefaultRuntime>
source§impl BuilderBuild<ThrottleableRuntime> for Builder
impl BuilderBuild<ThrottleableRuntime> for Builder
fn build(&mut self) -> Result<ThrottleableRuntime>
Auto Trait Implementations§
impl !Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl !UnwindSafe for Builder
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<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> 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
source§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