MCPcopy Index your code
hub / github.com/RustPython/RustPython / read_array

Method read_array

crates/compiler-core/src/marshal.rs:123–125  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

121 fn read_slice(&mut self, n: u32) -> Result<&[u8]>;
122
123 fn read_array<const N: usize>(&mut self) -> Result<&[u8; N]> {
124 self.read_slice(N as u32).map(|s| s.try_into().unwrap())
125 }
126
127 fn read_str(&mut self, len: u32) -> Result<&str> {
128 Ok(core::str::from_utf8(self.read_slice(len)?)?)

Callers

nothing calls this directly

Implementers 3

openssl.rscrates/stdlib/src/openssl.rs
socket.rscrates/stdlib/src/socket.rs
marshal.rscrates/compiler-core/src/marshal.rs

Calls 3

read_sliceMethod · 0.80
mapMethod · 0.45
unwrapMethod · 0.45

Tested by

no test coverage detected