Skip to main content

MaterialClone

Trait MaterialClone 

Source
pub trait MaterialClone {
    // Required method
    fn clone_box(&self) -> Box<dyn Material>;
}
Expand description

Supertrait that gives every material a clone_box without making Material itself depend on the non-object-safe Clone. The blanket impl below covers every T: Material + Clone, so concrete materials implement nothing extra.

Required Methods§

Source

fn clone_box(&self) -> Box<dyn Material>

Clones self into a new boxed dyn Material.

Implementors§

Source§

impl<T: Material + Clone + 'static> MaterialClone for T