Remove Executor::block_on and simplify Compositor creation
This commit is contained in:
parent
baadcc150f
commit
57cb14ce38
13 changed files with 58 additions and 108 deletions
|
|
@ -10,7 +10,7 @@ use thiserror::Error;
|
|||
use std::borrow::Cow;
|
||||
|
||||
/// A graphics compositor that can draw to windows.
|
||||
pub trait Compositor: Sized {
|
||||
pub trait Compositor: Sized + MaybeSend {
|
||||
/// The iced renderer of the backend.
|
||||
type Renderer;
|
||||
|
||||
|
|
@ -21,7 +21,7 @@ pub trait Compositor: Sized {
|
|||
fn new<W: Window + Clone>(
|
||||
settings: Settings,
|
||||
compatible_window: W,
|
||||
) -> impl Future<Output = Result<Self, Error>> {
|
||||
) -> impl Future<Output = Result<Self, Error>> + MaybeSend {
|
||||
Self::with_backend(settings, compatible_window, None)
|
||||
}
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ pub trait Compositor: Sized {
|
|||
_settings: Settings,
|
||||
_compatible_window: W,
|
||||
_backend: Option<&str>,
|
||||
) -> impl Future<Output = Result<Self, Error>>;
|
||||
) -> impl Future<Output = Result<Self, Error>> + MaybeSend;
|
||||
|
||||
/// Creates a [`Self::Renderer`] for the [`Compositor`].
|
||||
fn create_renderer(&self) -> Self::Renderer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue