pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
    {
        let f = File::open(path)?;
        let reader = BufReader::new(f);

        Ok(BlobReader {
            reader,
            offset: Some(ByteOffset(0)),
            last_blob_ok: true,
        })
    }
/// Tries to open the file at the given path and constructs a `BlobReader` from this.
///
/// # Errors
/// Returns the same errors that `std::fs::File::open` returns.
///
/// # Example
/// ```
/// use osmpbf::*;
///
/// # fn foo() -> Result<()> {
/// let reader = BlobReader::from_path("tests/test.osm.pbf")?;
/// # Ok(())
/// # }
/// # foo().unwrap();
/// ```
Tries to open the file at the given path and constructs a `BlobReader` from this.
Tries to open the file at the given path and constructs a ` BlobReader ` from this .
pub fn from_path<P: AsRef<Path>>(path: P) -> Result<Self>
    {
        let f = File::open(path)?;
        let reader = BufReader::new(f);
        Ok(BlobReader {
            reader,
            offset: Some(ByteOffset(0)),
            last_blob_ok: true,
        })
    }
pub fn from_path < P : AsRef < Path > > ( path : P ) -> Result < Self > { let f = File :: open ( path ) ? ; let reader = BufReader :: new ( f ) ; Ok ( BlobReader { reader , offset : Some ( ByteOffset ( 0 ) ) , last_blob_ok : true , } ) }
Tries to open the file at the given path and constructs a `BlobReader` from this.
Tries to open the file at the given path and constructs a ` BlobReader ` from this .
path
P
path
P
errors
Returns the same errors that `std::fs::File::open` returns.
Returns the same errors that ` std :: fs :: File :: open ` returns .
example
None
fn foo() -> result<()> {
let reader = BlobReader::from_path("tests/test.osm.pbf")?.
let reader = BlobReader :: from_path ( " tests / test . osm . pbf " ) ? .
ok(())
None
}
None
foo().unwrap();
None