pub struct ReactorSystem { /* private fields */ }Expand description
Lightweight dispatch handle for the reactor system.
Sits at the driver level (same as mio Poll or timer poller).
Reads ReactorNotify via pre-resolved ResourceId during
dispatch. All reactor storage and registration lives in
ReactorNotify (World resource).
Implementations§
Source§impl ReactorSystem
impl ReactorSystem
Sourcepub fn new(world: &World) -> Self
pub fn new(world: &World) -> Self
Create a dispatch handle from a built World.
The World must contain ReactorNotify and DeferredRemovals.
Sourcepub fn dispatch(&mut self, world: &mut World) -> bool
pub fn dispatch(&mut self, world: &mut World) -> bool
Dispatch all woken reactors and process deferred removals.
- Polls
ReactorNotifyfor woken reactor tokens (deduped) - Runs each reactor’s step function with pre-resolved Params
- Drains
DeferredRemovalsand removes reactors
Returns true if any reactor ran (for scheduler propagation).
Sourcepub fn reactor_count(&self, world: &World) -> usize
pub fn reactor_count(&self, world: &World) -> usize
Number of live reactors.
Auto Trait Implementations§
impl Freeze for ReactorSystem
impl RefUnwindSafe for ReactorSystem
impl Send for ReactorSystem
impl !Sync for ReactorSystem
impl Unpin for ReactorSystem
impl UnsafeUnpin for ReactorSystem
impl UnwindSafe for ReactorSystem
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