MCPcopy Create free account
hub / github.com/cretz/stackparam / require_n

Method require_n

src/bytecode/io/reader.rs:851–861  ·  view source on GitHub ↗
(reader: &mut BlockReader, count: usize, extractor: U)

Source from the content-addressed store, hash-verified

849 }
850
851 fn require_n<T, U>(reader: &mut BlockReader, count: usize, extractor: U) -> Result<T, Error> where U: Fn(BlockReader) -> T {
852 match reader.read_n(count) {
853 Ok(bytes) => {
854 let mut cursor = Cursor::new(bytes);
855 let r = BlockReader::new(&mut cursor);
856
857 Ok(extractor(r))
858 },
859 Err(err) => Err(err)
860 }
861 }
862}
863
864// TODO remove pub after testing

Callers

nothing calls this directly

Calls 1

read_nMethod · 0.80

Tested by

no test coverage detected