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

Method write_instructions

src/bytecode/io/writer.rs:359–370  ·  view source on GitHub ↗
(&mut self, instructions: &Vec<Instruction>)

Source from the content-addressed store, hash-verified

357 }
358
359 fn write_instructions(&mut self, instructions: &Vec<Instruction>) -> Result<usize, Error> {
360 let mut target: Vec<u8> = vec![];
361 let _ /*written_bytes*/ = {
362 let mut instr_writer = ClassWriter::new(&mut target);
363
364 instructions.iter().fold(0 as usize, |counter, instr| {
365 counter + instr_writer.render_instruction(instr, counter)
366 })
367 };
368
369 self.write_u32(target.len() as u32).and_then(|x| self.write_n(&target).map(|y| x + y))
370 }
371
372 /// Renders a single instruction into the output stream
373 fn render_instruction(&mut self, instruction: &Instruction, offset: usize) -> usize {

Callers 1

write_attributeMethod · 0.80

Calls 4

render_instructionMethod · 0.80
write_u32Method · 0.80
lenMethod · 0.80
write_nMethod · 0.80

Tested by

no test coverage detected