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

Method read_u32

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

Source from the content-addressed store, hash-verified

900 }
901
902 pub fn read_u32(&mut self) -> Result<u32, Error> {
903 let mut buf: [u8; 4] = [0; 4];
904
905 match self.source.read_exact(&mut buf) {
906 Ok(_) => {
907 self.position += 4;
908 Ok(
909 ((buf[0] as u32) << 24) +
910 ((buf[1] as u32) << 16) +
911 ((buf[2] as u32) << 8) +
912 buf[3] as u32)
913 },
914 Err(err) => Err(err)
915 }
916 }
917
918 #[allow(dead_code)]
919 pub fn get_u32(&mut self) -> u32 {

Callers 4

read_magic_bytesMethod · 0.80
read_constantMethod · 0.80
read_attributeMethod · 0.80
get_u32Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected