Lines Matching refs:PermutationState
15 state: PermutationState,
26 enum PermutationState { enum
67 let state = PermutationState::Complete(CompleteState::Start { n: 0, k: 0 }); in permutations()
85 PermutationState::StartUnknownLen { k } in permutations()
87 PermutationState::Empty in permutations()
109 PermutationState::StartUnknownLen { .. } => panic!("unexpected iterator state"), in next()
110 PermutationState::OngoingUnknownLen { k, min_n } => { in next()
116 PermutationState::Complete(CompleteState::Start { .. }) => None, in next()
117 PermutationState::Complete(CompleteState::Ongoing { ref indices, ref cycles }) => { in next()
122 PermutationState::Empty => None in next()
139 PermutationState::StartUnknownLen { k } => { in count()
145 PermutationState::OngoingUnknownLen { k, min_n } => { in count()
152 PermutationState::Complete(state) => from_complete(state), in count()
153 PermutationState::Empty => 0 in count()
159 PermutationState::StartUnknownLen { .. } | in size_hint()
160 … PermutationState::OngoingUnknownLen { .. } => (0, None), // TODO can we improve this lower bound? in size_hint()
161 PermutationState::Complete(ref state) => match state.remaining() { in size_hint()
165 PermutationState::Empty => (0, Some(0)) in size_hint()
179 PermutationState::StartUnknownLen { k } => { in advance()
180 PermutationState::OngoingUnknownLen { k, min_n: k } in advance()
182 PermutationState::OngoingUnknownLen { k, min_n } => { in advance()
184 PermutationState::OngoingUnknownLen { k, min_n: min_n + 1 } in advance()
195 PermutationState::Complete(complete_state) in advance()
198 PermutationState::Complete(ref mut state) => { in advance()
203 PermutationState::Empty => { return; } in advance()