goblin 0.0.7

An impish, cross-platform binary parsing and loading crate
Documentation
1
2
3
4
5
6
7
8
9
10
//TODO: peek the io file instead of using fully parsed buffer
//use std::fs::File;
//use std::io;
use scroll;
use error;

/// Returns a native endian magical number
pub fn peek_magic<S: scroll::Gread>(buffer: &S) -> error::Result<u32> {
    Ok(buffer.gread_with::<u32>(&mut 0, scroll::NATIVE)?)
}