pub struct Selector {
close_requested: AtomicBool,
token_wakeup: Token,
registry: Mutex<Registry>,
next_seed: AtomicUsize,
wakeup: Waker,
queued_modifications: Mutex<Vec<SelectorModification>>,
}Fields§
§close_requested: AtomicBoolSet to true when exiting the poll loop
token_wakeup: Token§registry: Mutex<Registry>The core assumption here is that this will always be the innermost lock, so we will never deadlock
next_seed: AtomicUsize§wakeup: WakerWaker to wake up the selectors own poll loop
queued_modifications: Mutex<Vec<SelectorModification>>Queued up modifications that will be processed immediately after we get new events
The core assumption here is that this will always be the innermost lock, so we will never deadlock
Implementations§
Source§impl Selector
impl Selector
pub fn new() -> Arc<Self>
pub fn shutdown(&self)
pub fn add( &self, handler: Box<dyn InterestHandler + Send + Sync>, source: &mut dyn Source, interests: Interest, ) -> Result<Token>
pub fn remove( &self, token: Token, source: Option<&mut dyn Source>, ) -> Result<()>
pub fn push_interest(&self, token: Token, interest: InterestType)
pub fn replace( &self, token: Token, handler: Box<dyn InterestHandler + Send + Sync>, )
Sourcefn queue_modification(&self, modification: SelectorModification)
fn queue_modification(&self, modification: SelectorModification)
Try to process a modification immediately, otherwise queue it up
Sourcefn take_queued_modifications(&self) -> Vec<SelectorModification>
fn take_queued_modifications(&self) -> Vec<SelectorModification>
Drain the queued modifications queue and return the modifications
fn run(engine: Arc<Selector>, poll: Poll)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnwindSafe for Selector
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