fn handle_iter<'a>(e: E, to_try: impl rayon::iter::ParallelIterator<Item=(&'a ListenerID, &'a Listener<E>)>) -> Vec<i64> where E: 'a {
        let (to_retry, mut to_remove) : (Vec<(&'a ListenerID, &'a Listener<E>)>, Vec<ListenerID>) = to_try.filter_map(|(k, v)| {
            match v.execute(&e) {
                Ok(_) => {
                    None
                },
                Err(e) => {
                    // If there was some kind of error, we need to store the error with the listener.
                    Some((k, v, e))
                },
            }
        }).partition_map(|(k, v, e)| {
            // The Either::Left is for listeners that can retry. The Either::Right is for listeners that must now be deleted.
            match e {
                ListenError::LockUnavailable => {
                    Either::Left((k, v))
                },
                ListenError::RequirementDeleted => {
                    Either::Right(*k)
                }
            }
        });

        if !to_retry.is_empty() {
            to_remove.append(&mut EventHandler::handle_iter(e, to_retry.into_par_iter()));
        }
        to_remove
    }
/// Returns a list of listeners to permanently remove from the event handler.
Returns a list of listeners to permanently remove from the event handler.
Returns a list of listeners to permanently remove from the event handler .
fn handle_iter<'a>(e: E, to_try: impl rayon::iter::ParallelIterator<Item=(&'a ListenerID, &'a Listener<E>)>) -> Vec<i64> where E: 'a {
        let (to_retry, mut to_remove) : (Vec<(&'a ListenerID, &'a Listener<E>)>, Vec<ListenerID>) = to_try.filter_map(|(k, v)| {
            match v.execute(&e) {
                Ok(_) => {
                    None
                },
                Err(e) => {
                    // If there was some kind of error, we need to store the error with the listener.
                    Some((k, v, e))
                },
            }
        }).partition_map(|(k, v, e)| {
            // The Either::Left is for listeners that can retry. The Either::Right is for listeners that must now be deleted.
            match e {
                ListenError::LockUnavailable => {
                    Either::Left((k, v))
                },
                ListenError::RequirementDeleted => {
                    Either::Right(*k)
                }
            }
        });
        if !to_retry.is_empty() {
            to_remove.append(&mut EventHandler::handle_iter(e, to_retry.into_par_iter()));
        }
        to_remove
    }
fn handle_iter < ' a > ( e : E , to_try : impl rayon :: iter :: ParallelIterator < Item = ( & ' a ListenerID , & ' a Listener < E > ) > ) -> Vec < i64 > where E : ' a { let ( to_retry , mut to_remove ) : ( Vec < ( & ' a ListenerID , & ' a Listener < E > ) > , Vec < ListenerID > ) = to_try . filter_map ( | ( k , v ) | { match v . execute ( & e ) { Ok ( _ ) => { None } , Err ( e ) => { // If there was some kind of error, we need to store the error with the listener. Some ( ( k , v , e ) ) } , } } ) . partition_map ( | ( k , v , e ) | { // The Either::Left is for listeners that can retry. The Either::Right is for listeners that must now be deleted. match e { ListenError :: LockUnavailable => { Either :: Left ( ( k , v ) ) } , ListenError :: RequirementDeleted => { Either :: Right ( * k ) } } } ) ; if ! to_retry . is_empty ( ) { to_remove . append ( & mut EventHandler :: handle_iter ( e , to_retry . into_par_iter ( ) ) ) ; } to_remove }
Returns a list of listeners to permanently remove from the event handler.
Returns a list of listeners to permanently remove from the event handler .
e
E
to_try
impl rayon::iter::ParallelIterator<Item=(&'a ListenerID, &'a Listener<E>)>
e
E
to_try
impl rayon::iter::ParallelIterator<Item=(&'a ListenerID, &'a Listener<E>)>