pub struct RuntimeBuilder { /* private fields */ }Expand description
Builder for configuring and creating an async runtime.
Provides a convenient way to configure the runtime’s I/O driver before building it.
§Examples
use vibeio::RuntimeBuilder;
let runtime = RuntimeBuilder::new()
.build();Implementations§
Source§impl RuntimeBuilder
impl RuntimeBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new runtime builder with default configuration.
By default, the builder will select the best available driver for the platform.
Sourcepub fn driver(self, driver_kind: DriverKind) -> Self
pub fn driver(self, driver_kind: DriverKind) -> Self
Sets the I/O driver for the runtime.
Sourcepub fn enable_timer(self, enable: bool) -> Self
pub fn enable_timer(self, enable: bool) -> Self
Enables or disables the timer for the runtime.
By default, the timer is disabled.
Sourcepub fn enable_fs_offload(self, enable: bool) -> Self
pub fn enable_fs_offload(self, enable: bool) -> Self
Enables or disables the offload of file I/O to blocking threads for the runtime.
By default, the fs offload is disabled.
Sourcepub fn blocking_pool(self, blocking_pool: Box<dyn BlockingThreadPool>) -> Self
pub fn blocking_pool(self, blocking_pool: Box<dyn BlockingThreadPool>) -> Self
Sets the blocking thread pool for the runtime.
Sourcepub fn default_blocking_pool(self, max_threads: usize) -> Self
pub fn default_blocking_pool(self, max_threads: usize) -> Self
Sets the default blocking thread pool for the runtime with specified maximum number of threads.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuntimeBuilder
impl !RefUnwindSafe for RuntimeBuilder
impl !Send for RuntimeBuilder
impl !Sync for RuntimeBuilder
impl Unpin for RuntimeBuilder
impl UnsafeUnpin for RuntimeBuilder
impl !UnwindSafe for RuntimeBuilder
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