MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / peekn

Method peekn

winch/codegen/src/stack.rs:390–396  ·  view source on GitHub ↗

Returns an iterator referencing the last n items of the stack, in bottom-most to top-most order.

(&self, n: usize)

Source from the content-addressed store, hash-verified

388 /// Returns an iterator referencing the last n items of the stack,
389 /// in bottom-most to top-most order.
390 pub fn peekn(&self, n: usize) -> impl Iterator<Item = &Val> + '_ {
391 let len = self.len();
392 assert!(n <= len);
393
394 let partition = len - n;
395 self.inner[partition..].into_iter()
396 }
397
398 /// Pops the top element of the stack, if any.
399 pub fn pop(&mut self) -> Option<Val> {

Callers 2

sizeofMethod · 0.45
assignMethod · 0.45

Calls 2

lenMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected