Struct pwgraster::PWGReader
[−]
[src]
pub struct PWGReader<R: Read> { /* fields omitted */ }
Top-level structure over a reader that returns decoded pages
Methods
impl<R: Read> PWGReader<R>
[src]
fn new(reader: R, syncword: bool) -> Result<Self, StreamError>
Construct a PWGReader over a byte reader
If syncword is true, read and validate the initial sync word that comes before the first page header. If false, the reader should point to a page header.
fn into_inner(self) -> R
Return the reader
fn next_page<T, F: Fn(PWGPage<R>) -> Result<T, StreamError>>(
&mut self,
f: F
) -> Result<Option<T>, StreamError>
&mut self,
f: F
) -> Result<Option<T>, StreamError>
Invoke a closure on the next page. The closure is passed a page structure which can return the header and unpack the page data.