/// Inserts an idle callback.
///
/// This callback will be called during a dispatching cycle when the event loop has
/// finished processing all pending events from the sources and becomes idle.
Inserts an idle callback.
This callback will be called during a dispatching cycle when the event loop has
finished processing all pending events from the sources and becomes idle.
Inserts an idle callback . This callback will be called during a dispatching cycle when the event loop has finished processing all pending events from the sources and becomes idle .
pub fn insert_idle<F: FnOnce(&mut Data) + 'l>(&self, callback: F) -> Idle {
        let mut opt_cb = Some(callback);
        let callback = Rc::new(RefCell::new(Some(move |data: &mut Data| {
            if let Some(cb) = opt_cb.take() {
                cb(data);
            }
        })));
        self.inner.idles.borrow_mut().push(callback.clone());
        Idle { callback }
    }
pub fn insert_idle < F : FnOnce ( & mut Data ) + ' l > ( & self , callback : F ) -> Idle { let mut opt_cb = Some ( callback ) ; let callback = Rc :: new ( RefCell :: new ( Some ( move | data : & mut Data | { if let Some ( cb ) = opt_cb . take ( ) { cb ( data ) ; } } ) ) ) ; self . inner . idles . borrow_mut ( ) . push ( callback . clone ( ) ) ; Idle { callback } }
Inserts an idle callback.
Inserts an idle callback .
&self
callback
F