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

Method try_fill_bytes

crates/wasi/src/random.rs:113–118  ·  view source on GitHub ↗
(&mut self, buf: &mut [u8])

Source from the content-addressed store, hash-verified

111 Ok(((w0 as u64) << 32) + (w1 as u64))
112 }
113 fn try_fill_bytes(&mut self, buf: &mut [u8]) -> Result<(), Infallible> {
114 for b in buf.iter_mut() {
115 *b = self.cycle.next().expect("infinite sequence");
116 }
117 Ok(())
118 }
119}
120
121#[cfg(test)]

Callers 1

deterministicFunction · 0.45

Calls 4

OkFunction · 0.85
iter_mutMethod · 0.45
expectMethod · 0.45
nextMethod · 0.45

Tested by 1

deterministicFunction · 0.36