pub fn drain(&mut self) -> impl Iterator<Item = T> + '_ {
        self.reset_start_event_count();

        let map = |i: EventInstance<T>| i.event;
        match self.state {
            State::A => self
                .events_b
                .drain(..)
                .map(map)
                .chain(self.events_a.drain(..).map(map)),
            State::B => self
                .events_a
                .drain(..)
                .map(map)
                .chain(self.events_b.drain(..).map(map)),
        }
    }
/// Creates a draining iterator that removes all events.
Creates a draining iterator that removes all events.
Creates a draining iterator that removes all events .
pub fn drain(&mut self) -> impl Iterator<Item = T> + '_ {
        self.reset_start_event_count();
        let map = |i: EventInstance<T>| i.event;
        match self.state {
            State::A => self
                .events_b
                .drain(..)
                .map(map)
                .chain(self.events_a.drain(..).map(map)),
            State::B => self
                .events_a
                .drain(..)
                .map(map)
                .chain(self.events_b.drain(..).map(map)),
        }
    }
pub fn drain ( & mut self ) -> impl Iterator < Item = T > + ' _ { self . reset_start_event_count ( ) ; let map = | i : EventInstance < T > | i . event ; match self . state { State :: A => self . events_b . drain ( .. ) . map ( map ) . chain ( self . events_a . drain ( .. ) . map ( map ) ) , State :: B => self . events_a . drain ( .. ) . map ( map ) . chain ( self . events_b . drain ( .. ) . map ( map ) ) , } }
Creates a draining iterator that removes all events.
Creates a draining iterator that removes all events .
&mut self
&mut self