pub fn write<P>(&self, full_path: &P) -> Result<(), StrError>
    where
        P: AsRef<OsStr> + ?Sized,
    {
        let path = Path::new(full_path).to_path_buf();
        if let Some(p) = path.parent() {
            fs::create_dir_all(p).map_err(|_| "cannot create directory")?;
        }
        let mut bin = Vec::new();
        let mut ser = rmp_serde::Serializer::new(&mut bin);
        self.serialize(&mut ser).map_err(|_| "serialize failed")?;
        let mut file = File::create(&path).map_err(|_| "cannot create file")?;
        file.write_all(&bin).map_err(|_| "cannot write file")?;
        Ok(())
    }
/// Writes a binary file with the mesh data
///
/// # Input
///
/// * `full_path` -- may be a String, &str, or Path
Writes a binary file with the mesh data
Writes a binary file with the mesh data
pub fn write<P>(&self, full_path: &P) -> Result<(), StrError>
    where
        P: AsRef<OsStr> + ?Sized,
    {
        let path = Path::new(full_path).to_path_buf();
        if let Some(p) = path.parent() {
            fs::create_dir_all(p).map_err(|_| "cannot create directory")?;
        }
        let mut bin = Vec::new();
        let mut ser = rmp_serde::Serializer::new(&mut bin);
        self.serialize(&mut ser).map_err(|_| "serialize failed")?;
        let mut file = File::create(&path).map_err(|_| "cannot create file")?;
        file.write_all(&bin).map_err(|_| "cannot write file")?;
        Ok(())
    }
pub fn write < P > ( & self , full_path : & P ) -> Result < ( ) , StrError > where P : AsRef < OsStr > + ? Sized , { let path = Path :: new ( full_path ) . to_path_buf ( ) ; if let Some ( p ) = path . parent ( ) { fs :: create_dir_all ( p ) . map_err ( | _ | " " ) ? ; } let mut bin = Vec :: new ( ) ; let mut ser = rmp_serde :: Serializer :: new ( & mut bin ) ; self . serialize ( & mut ser ) . map_err ( | _ | " " ) ? ; let mut file = File :: create ( & path ) . map_err ( | _ | " " ) ? ; file . write_all ( & bin ) . map_err ( | _ | " " ) ? ; Ok ( ( ) ) }
Writes a binary file with the mesh data
Writes a binary file with the mesh data
&self
full_path
&P
&self
full_path
&P
input
`full_path` -- may be a String, &str, or Path
` full_path ` -- may be a String &str or Path