pub enum MaterialComponent<T> {
None,
Value(T),
Texture(TextureHandle),
TextureValue {
texture: TextureHandle,
value: T,
},
}
Expand description
Generic container for a component of a material that could either be from a texture or a fixed value.
Variants§
Implementations§
Source§impl<T: Copy> MaterialComponent<T>
impl<T: Copy> MaterialComponent<T>
pub fn to_value(&self, default: T) -> T
pub fn is_texture(&self) -> bool
pub fn to_texture(&self) -> Option<&TextureHandle>
Trait Implementations§
Source§impl<T: Clone> Clone for MaterialComponent<T>
impl<T: Clone> Clone for MaterialComponent<T>
Source§fn clone(&self) -> MaterialComponent<T>
fn clone(&self) -> MaterialComponent<T>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<T: Debug> Debug for MaterialComponent<T>
impl<T: Debug> Debug for MaterialComponent<T>
Auto Trait Implementations§
impl<T> Freeze for MaterialComponent<T>where
T: Freeze,
impl<T> RefUnwindSafe for MaterialComponent<T>where
T: RefUnwindSafe,
impl<T> Send for MaterialComponent<T>where
T: Send,
impl<T> Sync for MaterialComponent<T>where
T: Sync,
impl<T> Unpin for MaterialComponent<T>where
T: Unpin,
impl<T> UnwindSafe for MaterialComponent<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more