ResourceBindings

Trait ResourceBindings 

Source
pub trait ResourceBindings<'r>: Sized {
    // Required method
    fn from_bindings(
        manager: &'r mut ResourceManager,
        mapping: Option<&ResourceMapping>,
    ) -> Result<Self, CuError>;
}
Expand description

Trait implemented by resource binding structs passed to task/bridge constructors. Implementors pull the concrete resources they need from the ResourceManager, using the symbolic mapping provided in the Copper config (resources: { name: "bundle.resource" }).

Required Methods§

Source

fn from_bindings( manager: &'r mut ResourceManager, mapping: Option<&ResourceMapping>, ) -> Result<Self, CuError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<'r> ResourceBindings<'r> for ()

Source§

fn from_bindings( _manager: &'r mut ResourceManager, _mapping: Option<&ResourceMapping>, ) -> Result<(), CuError>

Implementors§

Source§

impl<'r, T> ResourceBindings<'r> for CuAsyncTaskResources<'r, T>
where T: CuTask, <T as CuTask>::Resources<'r>: ResourceBindings<'r>,