[][src]Struct obj::Mtl

pub struct Mtl {
    pub filename: String,
    pub materials: Vec<Arc<Material>>,
}

The data represented by the mtllib command.

The material name is replaced by the actual material data when the material libraries are laoded if a match is found.

Fields

filename: String

Name of the .mtl file.

materials: Vec<Arc<Material>>

A list of loaded materials.

The individual materials are wrapped into an Arc to facilitate referencing this data where these materials are assigned in the .obj file.

Implementations

impl Mtl[src]

pub fn new(filename: String) -> Self[src]

Construct a new empty mtl lib with the given file name.

pub fn reload_with<R, F>(
    &mut self,
    obj_dir: impl AsRef<Path>,
    resolve: F
) -> Result<&mut Self, MtlError> where
    R: BufRead,
    F: FnMut(&Path, &str) -> Result<R>, 
[src]

Load the mtl library from the input buffer generated by the given closure.

This function overwrites the contents of this library if it has already been loaded.

pub fn reload(&mut self, input: impl Read) -> Result<&mut Self, MtlError>[src]

Load the mtl library from the given input buffer.

This function overwrites the contents of this library if it has already been loaded.

pub fn write_to_buf(&self, out: &mut impl Write) -> Result<(), Error>[src]

Trait Implementations

impl Clone for Mtl[src]

impl Debug for Mtl[src]

impl PartialEq<Mtl> for Mtl[src]

impl StructuralPartialEq for Mtl[src]

Auto Trait Implementations

impl RefUnwindSafe for Mtl

impl Send for Mtl

impl Sync for Mtl

impl Unpin for Mtl

impl UnwindSafe for Mtl

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.