pub mod auxv;
pub mod fd;
pub mod fdinfo;
pub mod limits;
pub mod net;
pub mod schedstat;
pub mod stat;
pub mod status;
use std::fs::File;
use std::io::BufRead;
use std::io::BufReader;
use std::io::Read;
use std::io::{self};
use std::path::Path;
pub trait FromRead: Sized {
fn from_read(reader: impl Read) -> io::Result<Self>;
fn from_file(path: impl AsRef<Path>) -> io::Result<Self> {
let file = File::open(path.as_ref())?;
Self::from_read(file)
}
}
pub trait FromBufRead: Sized {
fn from_buf_read(reader: impl BufRead) -> io::Result<Self>;
fn from_file(path: impl AsRef<Path>) -> io::Result<Self> {
let file = File::open(path.as_ref())?;
Self::from_buf_read(BufReader::new(file))
}
}