pub fn open<P: AsRef<Path>>(path: P) -> Result<GlbFile, String> {
        let path = path.as_ref();
        let content = fs::read(path)
            .map_err(|err| format!("Failed to read {:?}: {:?}", path, err) )?;

        let mut file = GlbFile {
            bin: content.into_boxed_slice(),
            bin_chunk_offset: 0,
            bin_chunk_size: 0,
            json: Value::Null,
        };

        file.parse_json()?;

        Ok(file)
    }
/// Read and parse a gltf binary file
Read and parse a gltf binary file
Read and parse a gltf binary file
pub fn open<P: AsRef<Path>>(path: P) -> Result<GlbFile, String> {
        let path = path.as_ref();
        let content = fs::read(path)
            .map_err(|err| format!("Failed to read {:?}: {:?}", path, err) )?;
        let mut file = GlbFile {
            bin: content.into_boxed_slice(),
            bin_chunk_offset: 0,
            bin_chunk_size: 0,
            json: Value::Null,
        };
        file.parse_json()?;
        Ok(file)
    }
pub fn open < P : AsRef < Path > > ( path : P ) -> Result < GlbFile , String > { let path = path . as_ref ( ) ; let content = fs :: read ( path ) . map_err ( | err | format ! ( " " path err ) ) ? ; let mut file = GlbFile { bin : content . into_boxed_slice ( ) , bin_chunk_offset : 0 , bin_chunk_size : 0 , json : Value :: Null , } ; file . parse_json ( ) ? ; Ok ( file ) }
Read and parse a gltf binary file
Read and parse a gltf binary file
path
P