[−][src]Struct obj::Mtl
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]
&mut self,
obj_dir: impl AsRef<Path>,
resolve: F
) -> Result<&mut Self, MtlError> where
R: BufRead,
F: FnMut(&Path, &str) -> Result<R>,
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,