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

Method renumber

crates/wasi-common/src/table.rs:108–113  ·  view source on GitHub ↗

Remove a resource at a given index from the table. Returns the resource if it was present.

(&self, from: u32, to: u32)

Source from the content-addressed store, hash-verified

106 /// Remove a resource at a given index from the table. Returns the resource
107 /// if it was present.
108 pub fn renumber(&self, from: u32, to: u32) -> Result<(), Error> {
109 let map = &mut self.0.write().unwrap().map;
110 let from_entry = map.remove(&from).ok_or(Error::badf())?;
111 map.insert(to, from_entry);
112 Ok(())
113 }
114}

Callers 1

fd_renumberMethod · 0.45

Calls 5

OkFunction · 0.85
unwrapMethod · 0.45
writeMethod · 0.45
removeMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected