wgpu: require Send on stored pipelines

This commit is contained in:
Tomáš Zemanovič 2024-01-11 14:45:40 +00:00
parent fba5326e13
commit 3c6bb0a076
No known key found for this signature in database
GPG key ID: AD85EEC9402E24AD

View file

@ -82,7 +82,7 @@ impl<Theme> Renderer for crate::Renderer<Theme> {
/// Stores custom, user-provided pipelines.
#[derive(Default, Debug)]
pub struct Storage {
pipelines: HashMap<TypeId, Box<dyn Any>>,
pipelines: HashMap<TypeId, Box<dyn Any + Send>>,
}
impl Storage {
@ -92,7 +92,7 @@ impl Storage {
}
/// Inserts the pipeline `T` in to [`Storage`].
pub fn store<T: 'static>(&mut self, pipeline: T) {
pub fn store<T: 'static + Send>(&mut self, pipeline: T) {
let _ = self.pipelines.insert(TypeId::of::<T>(), Box::new(pipeline));
}