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

Method read_u8

src/bytecode/io/reader.rs:939–949  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

937 }
938
939 pub fn read_u8(&mut self) -> Result<u8, Error> {
940 let mut buf: [u8; 1] = [0; 1];
941
942 match self.source.read_exact(&mut buf) {
943 Ok(_) => {
944 self.position += 1;
945 Ok(buf[0])
946 },
947 Err(err) => Err(err)
948 }
949 }
950
951 pub fn get_u8(&mut self) -> u8 {
952 self.read_u8().unwrap_or(0)

Callers 2

read_constantMethod · 0.80
get_u8Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected