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

Method unwrap_inner

cranelift/bforest/src/node.rs:98–112  ·  view source on GitHub ↗

Unwrap an inner node into two slices (keys, trees).

(&self)

Source from the content-addressed store, hash-verified

96
97 /// Unwrap an inner node into two slices (keys, trees).
98 pub fn unwrap_inner(&self) -> (&[F::Key], &[Node]) {
99 match *self {
100 Self::Inner {
101 size,
102 ref keys,
103 ref tree,
104 } => {
105 let size = usize::from(size);
106 // TODO: We could probably use `get_unchecked()` here since `size` is always in
107 // range.
108 (&keys[0..size], &tree[0..=size])
109 }
110 _ => panic!("Expected inner node"),
111 }
112 }
113
114 /// Unwrap a leaf node into two slices (keys, values) of the same length.
115 pub fn unwrap_leaf(&self) -> (&[F::Key], &[F::Value]) {

Callers 4

next_nodeMethod · 0.80
prev_leafMethod · 0.80
current_crit_keyMethod · 0.80
right_siblingMethod · 0.80

Calls 1

fromFunction · 0.85

Tested by

no test coverage detected