pub fn extract_all_ballots_separated_by_key(&'_ mut self,custom_sort:Option<Box<dyn FnMut(&Transcript<Tally>,<S as HowSplitByCountNumber>::KeyToDivide,<S as HowSplitByCountNumber>::KeyToDivide)->Ordering>>,transcript:&Transcript<Tally>) -> Vec<(TransferValue,(Tally,VotesWithSameTransferValue<'a>,PortionOfReasonBeingDoneThisCount))> {
        let mut res = vec![];
        let mut sorted_by_key : Vec<_> = self.by_provenance.drain().collect(); // not sorted yet
        if let Some(mut f) = custom_sort {
            sorted_by_key.sort_by(|((key1,_),_),((key2,_),_)|f(transcript,key1.clone(),key2.clone()));
        } else {
            sorted_by_key.sort_by_key(|((key,_),_)|key.clone()); // now sorted.
        }
        for ((_key,tv),(prov,votes)) in sorted_by_key {
            let provenance = PortionOfReasonBeingDoneThisCount{
                transfer_value: Some(tv.clone()),
                when_tv_created: prov.when_tv_created,
                papers_came_from_counts: prov.counts_comes_from.iter().cloned().collect(),
            };
            res.push((tv.clone(),(prov.tally,votes,provenance)));
        }
        res
    }
/// Extracts all the ballots, without doing any merging.
/// Clears this object.
/// Sorting will be by  the standard Ord on the key, unless overridden by a custom function.
Extracts all the ballots, without doing any merging.
Clears this object.
Sorting will be by  the standard Ord on the key, unless overridden by a custom function.
Extracts all the ballots without doing any merging . Clears this object . Sorting will be by the standard Ord on the key unless overridden by a custom function .
pub fn extract_all_ballots_separated_by_key(&'_ mut self,custom_sort:Option<Box<dyn FnMut(&Transcript<Tally>,<S as HowSplitByCountNumber>::KeyToDivide,<S as HowSplitByCountNumber>::KeyToDivide)->Ordering>>,transcript:&Transcript<Tally>) -> Vec<(TransferValue,(Tally,VotesWithSameTransferValue<'a>,PortionOfReasonBeingDoneThisCount))> {
        let mut res = vec![];
        let mut sorted_by_key : Vec<_> = self.by_provenance.drain().collect(); // not sorted yet
        if let Some(mut f) = custom_sort {
            sorted_by_key.sort_by(|((key1,_),_),((key2,_),_)|f(transcript,key1.clone(),key2.clone()));
        } else {
            sorted_by_key.sort_by_key(|((key,_),_)|key.clone()); // now sorted.
        }
        for ((_key,tv),(prov,votes)) in sorted_by_key {
            let provenance = PortionOfReasonBeingDoneThisCount{
                transfer_value: Some(tv.clone()),
                when_tv_created: prov.when_tv_created,
                papers_came_from_counts: prov.counts_comes_from.iter().cloned().collect(),
            };
            res.push((tv.clone(),(prov.tally,votes,provenance)));
        }
        res
    }
pub fn extract_all_ballots_separated_by_key ( & ' _ mut self , custom_sort : Option < Box < dyn FnMut ( & Transcript < Tally > , < S as HowSplitByCountNumber > :: KeyToDivide , < S as HowSplitByCountNumber > :: KeyToDivide ) -> Ordering > > , transcript : & Transcript < Tally > ) -> Vec < ( TransferValue , ( Tally , VotesWithSameTransferValue < ' a > , PortionOfReasonBeingDoneThisCount ) ) > { let mut res = vec ! [ ] ; let mut sorted_by_key : Vec < _ > = self . by_provenance . drain ( ) . collect ( ) ; // not sorted yet if let Some ( mut f ) = custom_sort { sorted_by_key . sort_by ( | ( ( key1 , _ ) , _ ) , ( ( key2 , _ ) , _ ) | f ( transcript , key1 . clone ( ) , key2 . clone ( ) ) ) ; } else { sorted_by_key . sort_by_key ( | ( ( key , _ ) , _ ) | key . clone ( ) ) ; // now sorted. } for ( ( _key , tv ) , ( prov , votes ) ) in sorted_by_key { let provenance = PortionOfReasonBeingDoneThisCount { transfer_value : Some ( tv . clone ( ) ) , when_tv_created : prov . when_tv_created , papers_came_from_counts : prov . counts_comes_from . iter ( ) . cloned ( ) . collect ( ) , } ; res . push ( ( tv . clone ( ) , ( prov . tally , votes , provenance ) ) ) ; } res }
Extracts all the ballots, without doing any merging.
Extracts all the ballots without doing any merging .
&'_ mut self
custom_sort
Option<Box<dyn FnMut(&Transcript<Tally>,<S as HowSplitByCountNumber>::KeyToDivide,<S as HowSplitByCountNumber>::KeyToDivide)->Ordering>>
transcript
&Transcript<Tally>
&'_ mut self
custom_sort
Option<Box<dyn FnMut(&Transcript<Tally>,<S as HowSplitByCountNumber>::KeyToDivide,<S as HowSplitByCountNumber>::KeyToDivide)->Ordering>>
transcript
&Transcript<Tally>