Add Send + Sync bounds for user-defined errors (#197)
- This enables compatibility with anyhow and the async ecosystem
This commit is contained in:
parent
db00a67c60
commit
50c77a5f83
|
@ -117,9 +117,11 @@ pub enum Error {
|
||||||
Surface(wgpu::SurfaceError),
|
Surface(wgpu::SurfaceError),
|
||||||
/// User-defined error from custom render function
|
/// User-defined error from custom render function
|
||||||
#[error("User-defined error.")]
|
#[error("User-defined error.")]
|
||||||
UserDefined(#[from] Box<dyn std::error::Error>),
|
UserDefined(#[from] DynError),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type DynError = Box<dyn std::error::Error + Send + Sync + 'static>;
|
||||||
|
|
||||||
impl<'win, W: HasRawWindowHandle> SurfaceTexture<'win, W> {
|
impl<'win, W: HasRawWindowHandle> SurfaceTexture<'win, W> {
|
||||||
/// Create a logical texture for a window surface.
|
/// Create a logical texture for a window surface.
|
||||||
///
|
///
|
||||||
|
@ -357,7 +359,7 @@ impl Pixels {
|
||||||
&mut wgpu::CommandEncoder,
|
&mut wgpu::CommandEncoder,
|
||||||
&wgpu::TextureView,
|
&wgpu::TextureView,
|
||||||
&PixelsContext,
|
&PixelsContext,
|
||||||
) -> Result<(), Box<dyn std::error::Error>>,
|
) -> Result<(), DynError>,
|
||||||
{
|
{
|
||||||
let frame = self
|
let frame = self
|
||||||
.context
|
.context
|
||||||
|
|
Loading…
Reference in a new issue