pub struct StrategyRegistry { /* private fields */ }Expand description
Registry of available shading strategies, looked up by name.
Implementations§
Source§impl StrategyRegistry
impl StrategyRegistry
pub fn register(&mut self, strategy: impl ShadingStrategy + 'static)
pub fn by_name(&self, name: &str) -> Option<Arc<dyn ShadingStrategy>>
Sourcepub fn resolve(
&self,
material: &Material,
) -> Result<Vec<MaterialValue>, MaterialError>
pub fn resolve( &self, material: &Material, ) -> Result<Vec<MaterialValue>, MaterialError>
Looks up the strategy named by material.strategy, validates the
material against it, and resolves it.
Trait Implementations§
Source§impl Default for StrategyRegistry
impl Default for StrategyRegistry
Source§fn default() -> StrategyRegistry
fn default() -> StrategyRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for StrategyRegistry
impl !UnwindSafe for StrategyRegistry
impl Freeze for StrategyRegistry
impl Send for StrategyRegistry
impl Sync for StrategyRegistry
impl Unpin for StrategyRegistry
impl UnsafeUnpin for StrategyRegistry
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