MCPcopy Create free account
hub / github.com/hashintel/hash / next

Function next

libs/error-stack/src/iter.rs:33–48  ·  view source on GitHub ↗

Helper function, which is used in both [`Frames`] and the mutable frame traversals on [`Report`]. [`Report`]: crate::Report To traverse the frames, the following algorithm is used: Given a list of iterators, take the last iterator, and use items from it until the iterator has been exhausted. If that is the case (it returned `None`), remove the iterator from the list, and continue with the next i

(iter: &mut Vec<I>)

Source from the content-addressed store, hash-verified

31/// 8) Out: H Stack: -
32/// ```
33pub(crate) fn next<I: Iterator<Item = T>, T>(iter: &mut Vec<I>) -> Option<T> {
34 let out;
35 loop {
36 let last = iter.last_mut()?;
37
38 if let Some(next) = last.next() {
39 out = next;
40 break;
41 }
42
43 // exhausted, therefore cannot be used anymore.
44 iter.pop();
45 }
46
47 Some(out)
48}
49
50/// Iterator over the [`Frame`] stack of a [`Report`].
51///

Callers 10

frames_mutMethod · 0.70
downcast_mutMethod · 0.70
nextMethod · 0.70
mainFunction · 0.50
createAuthMiddlewareFunction · 0.50
signedUpMiddlewareFunction · 0.50
loggedInMiddlewareFunction · 0.50
releaseSessionSlotFunction · 0.50

Calls 2

popMethod · 0.65
nextMethod · 0.45

Tested by

no test coverage detected