[][src]Struct lhef::Reader

pub struct Reader<T> { /* fields omitted */ }

Reader for the LHEF format

Implementations

impl<T: BufRead> Reader<T>[src]

pub fn new(stream: T) -> Result<Reader<T>, Box<dyn Error>>[src]

Create a new LHEF reader

Example

let file = std::fs::File::open("events.lhe").unwrap();
let file = std::io::BufReader::new(file);
let reader = lhef::Reader::new(file).unwrap();

pub fn version(&self) -> &str[src]

Get the LHEF version

pub fn header(&self) -> &str[src]

Get the LHEF header

pub fn xml_header(&self) -> &Option<XmlTree>[src]

Get the LHEF xml header

pub fn heprup(&self) -> &HEPRUP[src]

Get the run information in HEPRUP format

pub fn hepeup(&mut self) -> Result<Option<HEPEUP>, Box<dyn Error>>[src]

Get the next event in HEPEUP format

Example

let file = std::fs::File::open("events.lhe").unwrap();
let file = std::io::BufReader::new(file);
let mut reader = lhef::Reader::new(file).unwrap();

let event = reader.hepeup().unwrap();
match event {
   Some(event) => println!("Found an event."),
   None => println!("Reached end of event file."),
}

Trait Implementations

impl<T: Debug> Debug for Reader<T>[src]

impl<T: PartialEq> PartialEq<Reader<T>> for Reader<T>[src]

impl<T> StructuralPartialEq for Reader<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Reader<T> where
    T: RefUnwindSafe

impl<T> Send for Reader<T> where
    T: Send

impl<T> Sync for Reader<T> where
    T: Sync

impl<T> Unpin for Reader<T> where
    T: Unpin

impl<T> UnwindSafe for Reader<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.