Skip to main content

MtlWriter

Trait MtlWriter 

Source
pub trait MtlWriter<F: ObjFloat = f64> {
    // Required methods
    fn write_comment<S: AsRef<str>>(&mut self, comment: S) -> Result<()>;
    fn write_new_material<S: AsRef<str>>(&mut self, name: S) -> Result<()>;
    fn write_ambient(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>;
    fn write_diffuse(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>;
    fn write_specular(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>;
    fn write_emissive(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>;
    fn write_specular_exponent(&mut self, value: F) -> Result<()>;
    fn write_optical_density(&mut self, value: F) -> Result<()>;
    fn write_dissolve(&mut self, value: F) -> Result<()>;
    fn write_transparency(&mut self, value: F) -> Result<()>;
    fn write_illumination_model(&mut self, value: u32) -> Result<()>;
    fn write_map<S: AsRef<str>>(&mut self, kind: MapKind, args: S) -> Result<()>;
}
Expand description

Trait for writing MTL data. Mirror of MtlReader.

Required Methods§

Source

fn write_comment<S: AsRef<str>>(&mut self, comment: S) -> Result<()>

Source

fn write_new_material<S: AsRef<str>>(&mut self, name: S) -> Result<()>

Source

fn write_ambient(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>

Source

fn write_diffuse(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>

Source

fn write_specular(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>

Source

fn write_emissive(&mut self, r: F, g: Option<F>, b: Option<F>) -> Result<()>

Source

fn write_specular_exponent(&mut self, value: F) -> Result<()>

Source

fn write_optical_density(&mut self, value: F) -> Result<()>

Source

fn write_dissolve(&mut self, value: F) -> Result<()>

Source

fn write_transparency(&mut self, value: F) -> Result<()>

Source

fn write_illumination_model(&mut self, value: u32) -> Result<()>

Source

fn write_map<S: AsRef<str>>(&mut self, kind: MapKind, args: S) -> Result<()>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<W: Write, F: ObjFloat> MtlWriter<F> for IoMtlWriter<W, F>