use byteorder::{ByteOrder, ReadBytesExt};
use std::io::Read;
#[derive(Debug, Clone, Copy)]
pub struct PerfFileSection {
pub offset: u64,
pub size: u64,
}
impl PerfFileSection {
pub const STRUCT_SIZE: u64 = 8 + 8;
pub fn parse<R: Read, T: ByteOrder>(mut reader: R) -> Result<Self, std::io::Error> {
let offset = reader.read_u64::<T>()?;
let size = reader.read_u64::<T>()?;
Ok(Self { offset, size })
}
}