fn add_entry(&mut self, entry: Arc<Entry>, when: u64) {
        use crate::time::wheel::InsertError;

        entry.set_when_internal(Some(when));

        match self.wheel.insert(when, entry, &mut ()) {
            Ok(_) => {}
            Err((entry, InsertError::Elapsed)) => {
                // The entry's deadline has elapsed, so fire it and update the
                // internal state accordingly.
                entry.set_when_internal(None);
                entry.fire(when);
            }
            Err((entry, InsertError::Invalid)) => {
                error!("add_entry::wheel.insert error");
                // The entry's deadline is invalid, so error it and update the
                // internal state accordingly.
                entry.set_when_internal(None);
                entry.error();
            }
        }
    }
/// Fires the entry if it needs to, otherwise queue it to be processed later.
///
/// Returns `None` if the entry was fired.
Fires the entry if it needs to, otherwise queue it to be processed later.
Returns `None` if the entry was fired.
Fires the entry if it needs to otherwise queue it to be processed later . Returns ` None ` if the entry was fired .
fn add_entry(&mut self, entry: Arc<Entry>, when: u64) {
        use crate::time::wheel::InsertError;
        entry.set_when_internal(Some(when));
        match self.wheel.insert(when, entry, &mut ()) {
            Ok(_) => {}
            Err((entry, InsertError::Elapsed)) => {
                // The entry's deadline has elapsed, so fire it and update the
                // internal state accordingly.
                entry.set_when_internal(None);
                entry.fire(when);
            }
            Err((entry, InsertError::Invalid)) => {
                error!("add_entry::wheel.insert error");
                // The entry's deadline is invalid, so error it and update the
                // internal state accordingly.
                entry.set_when_internal(None);
                entry.error();
            }
        }
    }
fn add_entry ( & mut self , entry : Arc < Entry > , when : u64 ) { use crate :: time :: wheel :: InsertError ; entry . set_when_internal ( Some ( when ) ) ; match self . wheel . insert ( when , entry , & mut ( ) ) { Ok ( _ ) => { } Err ( ( entry , InsertError :: Elapsed ) ) => { // The entry's deadline has elapsed, so fire it and update the // internal state accordingly. entry . set_when_internal ( None ) ; entry . fire ( when ) ; } Err ( ( entry , InsertError :: Invalid ) ) => { error ! ( " " ) ; // The entry's deadline is invalid, so error it and update the // internal state accordingly. entry . set_when_internal ( None ) ; entry . error ( ) ; } } }
Fires the entry if it needs to, otherwise queue it to be processed later.
Fires the entry if it needs to otherwise queue it to be processed later .
&mut self
entry
Arc<Entry>
when
u64