pub fn seek(&mut self, pos: ByteOffset) -> Result<()> {
        match self.reader.seek(SeekFrom::Start(pos.0)) {
            Ok(offset) => {
                self.offset = Some(ByteOffset(offset));
                Ok(())
            },
            Err(e) => {
                self.offset = None;
                Err(e.into())
            },
        }
    }
/// Seek to an offset in bytes from the start of the stream.
///
/// # Example
/// ```
/// use osmpbf::*;
///
/// # fn foo() -> Result<()> {
/// let mut reader = BlobReader::from_path("tests/test.osm.pbf")?;
/// let first_blob = reader.next().unwrap()?;
/// let second_blob = reader.next().unwrap()?;
///
/// reader.seek(first_blob.offset().unwrap())?;
///
/// let first_blob_again = reader.next().unwrap()?;
/// assert_eq!(first_blob.offset(), first_blob_again.offset());
/// # Ok(())
/// # }
/// # foo().unwrap();
/// ```
Seek to an offset in bytes from the start of the stream.
Seek to an offset in bytes from the start of the stream .
pub fn seek(&mut self, pos: ByteOffset) -> Result<()> {
        match self.reader.seek(SeekFrom::Start(pos.0)) {
            Ok(offset) => {
                self.offset = Some(ByteOffset(offset));
                Ok(())
            },
            Err(e) => {
                self.offset = None;
                Err(e.into())
            },
        }
    }
pub fn seek ( & mut self , pos : ByteOffset ) -> Result < ( ) > { match self . reader . seek ( SeekFrom :: Start ( pos . 0 ) ) { Ok ( offset ) => { self . offset = Some ( ByteOffset ( offset ) ) ; Ok ( ( ) ) } , Err ( e ) => { self . offset = None ; Err ( e . into ( ) ) } , } }
Seek to an offset in bytes from the start of the stream.
Seek to an offset in bytes from the start of the stream .
&mut self
pos
ByteOffset
&mut self
pos
ByteOffset
example
None
fn foo() -> result<()> {
let mut reader = BlobReader::from_path("tests/test.osm.pbf")?;
let first_blob = reader.next().unwrap()?;
let second_blob = reader.next().unwrap()?.

reader.seek(first_blob.offset().unwrap())?.

let first_blob_again = reader.next().unwrap()?;
assert_eq!(first_blob.offset(), first_blob_again.offset()).
let mut reader = BlobReader :: from_path ( " tests / test . osm . pbf " ) ? ; let first_blob = reader . next () . unwrap () ? ; let second_blob = reader . next () . unwrap () ? . reader . seek ( first_blob . offset () . unwrap () ) ? . let first_blob_again = reader . next () . unwrap () ? ; assert_eq! ( first_blob . offset () first_blob_again . offset () ) .
ok(())
None
}
None
foo().unwrap();
None