Skip to main content

Builder

Struct Builder 

Source
pub struct Builder { /* private fields */ }
Expand description

A setup builder for your level runtime.

See tokio::runtime::Builder for more detailed documentation. A level runtime is a collection of tokio current-thread runtimes.

Implementations§

Source§

impl Builder

Source

pub fn build(&mut self) -> LevelRuntime

Build a new level runtime

Source

pub fn worker_threads(&mut self, threads: usize) -> &mut Self

How many thread-local worker threads do you want?

Source

pub fn thread_name_prefix(&mut self, name: impl Into<String>) -> &mut Self

Set a thread name prefix for level threads.

Source

pub fn enable_all(&mut self) -> &mut Self

Do you want to use IO and time?

Source

pub fn event_interval(&mut self, interval: u32) -> &mut Self

How frequently should you epoll? (Default is 61)

Source

pub fn global_queue_interval(&mut self, interval: u32) -> &mut Self

How frequently should you check for off-runtime task submission? (Default is 31)

Source

pub fn max_io_events_per_tick(&mut self, capacity: usize) -> &mut Self

How many file descriptors should you epoll at a time? (Default is 1024)

Source

pub fn max_blocking_threads(&mut self, capacity: usize) -> &mut Self

How many blocking threads should each local runtime be able to create? (Devault is 512)

Source

pub fn on_thread_park( &mut self, f: impl Fn() + Send + Sync + 'static, ) -> &mut Self

Notification of thread park

Source

pub fn on_thread_unpark( &mut self, f: impl Fn() + Send + Sync + 'static, ) -> &mut Self

Notification of thread unpark

Trait Implementations§

Source§

impl Default for Builder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V