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

Method as_mut_slice

cranelift/entity/src/list.rs:336–342  ·  view source on GitHub ↗

Get the list as a mutable slice.

(&'a mut self, pool: &'a mut ListPool<T>)

Source from the content-addressed store, hash-verified

334
335 /// Get the list as a mutable slice.
336 pub fn as_mut_slice<'a>(&'a mut self, pool: &'a mut ListPool<T>) -> &'a mut [T] {
337 let idx = self.index as usize;
338 match pool.len_of(self) {
339 None => &mut [],
340 Some(len) => &mut pool.data[idx..idx + len],
341 }
342 }
343
344 /// Get a mutable reference to a single element from the list.
345 pub fn get_mut<'a>(&'a mut self, index: usize, pool: &'a mut ListPool<T>) -> Option<&'a mut T> {

Callers 6

get_mutMethod · 0.45
insertMethod · 0.45
removeMethod · 0.45
swap_removeMethod · 0.45
growingFunction · 0.45
deep_cloneFunction · 0.45

Calls 1

len_ofMethod · 0.80

Tested by 2

growingFunction · 0.36
deep_cloneFunction · 0.36