fn next_scan(scan: &mut Scan) -> bool {
    let (index, is_new) = match (&scan.flow, &scan.index) {
        // For out-out, we can use the attribute-leading indexes.
        (Flow::OutOut, Index::Aevt) => (Index::Avet, true),
        (Flow::OutOut, Index::Avet) => (Index::Aevt, false),
        (Flow::OutOut, Index::Eavt) => panic!("Using eavt for out-out is invalid."),

        // For in-in, we can use all three indexes.
        (Flow::InIn, Index::Aevt) => (Index::Avet, true),
        (Flow::InIn, Index::Avet) => (Index::Eavt, true),
        (Flow::InIn, Index::Eavt) => (Index::Aevt, false),

        // For in-out, we need to keep the slot that is the input (either the
        // entity or the value) the input, and the other one the output. There
        // are two cycles here, one of length 2, and one of length 1.
        (Flow::InOut, Index::Aevt) => (Index::Eavt, true),
        (Flow::InOut, Index::Eavt) => (Index::Aevt, false),
        (Flow::InOut, Index::Avet) => (Index::Avet, false),
    };

    scan.index = index;
    is_new
}
/// Update a scan in-place to a different scan that fills the same slots.
///
/// Returns true when incremented to a new scan in the cycle, and false when we
/// cycled back to the initial scan.
Update a scan in-place to a different scan that fills the same slots.
Returns true when incremented to a new scan in the cycle, and false when we
cycled back to the initial scan.
Update a scan in - place to a different scan that fills the same slots . Returns true when incremented to a new scan in the cycle and false when we cycled back to the initial scan .
fn next_scan(scan: &mut Scan) -> bool {
    let (index, is_new) = match (&scan.flow, &scan.index) {
        // For out-out, we can use the attribute-leading indexes.
        (Flow::OutOut, Index::Aevt) => (Index::Avet, true),
        (Flow::OutOut, Index::Avet) => (Index::Aevt, false),
        (Flow::OutOut, Index::Eavt) => panic!("Using eavt for out-out is invalid."),
        // For in-in, we can use all three indexes.
        (Flow::InIn, Index::Aevt) => (Index::Avet, true),
        (Flow::InIn, Index::Avet) => (Index::Eavt, true),
        (Flow::InIn, Index::Eavt) => (Index::Aevt, false),
        // For in-out, we need to keep the slot that is the input (either the
        // entity or the value) the input, and the other one the output. There
        // are two cycles here, one of length 2, and one of length 1.
        (Flow::InOut, Index::Aevt) => (Index::Eavt, true),
        (Flow::InOut, Index::Eavt) => (Index::Aevt, false),
        (Flow::InOut, Index::Avet) => (Index::Avet, false),
    };
    scan.index = index;
    is_new
}
fn next_scan ( scan : & mut Scan ) -> bool { let ( index , is_new ) = match ( & scan . flow , & scan . index ) { // For out-out, we can use the attribute-leading indexes. ( Flow :: OutOut , Index :: Aevt ) => ( Index :: Avet , true ) , ( Flow :: OutOut , Index :: Avet ) => ( Index :: Aevt , false ) , ( Flow :: OutOut , Index :: Eavt ) => panic ! ( " " ) , // For in-in, we can use all three indexes. ( Flow :: InIn , Index :: Aevt ) => ( Index :: Avet , true ) , ( Flow :: InIn , Index :: Avet ) => ( Index :: Eavt , true ) , ( Flow :: InIn , Index :: Eavt ) => ( Index :: Aevt , false ) , // For in-out, we need to keep the slot that is the input (either the // entity or the value) the input, and the other one the output. There // are two cycles here, one of length 2, and one of length 1. ( Flow :: InOut , Index :: Aevt ) => ( Index :: Eavt , true ) , ( Flow :: InOut , Index :: Eavt ) => ( Index :: Aevt , false ) , ( Flow :: InOut , Index :: Avet ) => ( Index :: Avet , false ) , } ; scan . index = index ; is_new }
Update a scan in-place to a different scan that fills the same slots.
Update a scan in - place to a different scan that fills the same slots .
scan
&mut Scan
scan
&mut Scan