pub struct Proactor { /* private fields */ }Expand description
The process’s proactor: its configuration, and the IO of the calling thread’s shard.
Implementations§
Source§impl Proactor
impl Proactor
Sourcepub fn get() -> &'static Proactor
pub fn get() -> &'static Proactor
The proactor, with the default configuration unless
with_config set one first.
Sourcepub fn with_config(config: NucleiConfig) -> &'static Proactor
pub fn with_config(config: NucleiConfig) -> &'static Proactor
Sets the proactor’s configuration, and returns the proactor. It is
the default every runtime starts from;
Builder::io_uring gives one runtime
ring settings of its own, checked when it is built.
§Panics
When the proactor was configured already, or used (which configures
it with the defaults): a configuration is set once, before any IO.
The signature returns the proactor itself, so it has no error to
answer; Builder::io_uring answers its error instead.
Sourcepub fn config(&self) -> &NucleiConfig
pub fn config(&self) -> &NucleiConfig
The configuration in place.
Sourcepub fn wait(
&self,
max_event_size: usize,
duration: Option<Duration>,
) -> Result<usize>
pub fn wait( &self, max_event_size: usize, duration: Option<Duration>, ) -> Result<usize>
Drives the calling thread’s shard once: runs its ready tasks, waits
for IO (up to duration; None until some comes or wake),
handling at most max_event_size events, and runs the tasks the IO
woke. Returns how many IO events it handled.
§Errors
When the thread’s shard cannot start, or its poller fails.