diff options
author | 2021-07-13 21:15:07 +0200 | |
---|---|---|
committer | 2021-07-13 21:15:07 +0200 | |
commit | 5df2a92f28be1d53d32d5b42a6645459b7d78efe (patch) | |
tree | 424a30db96af6864b4c505b5358eb9ef18b40a13 /src | |
parent | 4abaee8b2354a666a75e4eb5ec9cc9a744936813 (diff) | |
download | iced-5df2a92f28be1d53d32d5b42a6645459b7d78efe.tar.gz iced-5df2a92f28be1d53d32d5b42a6645459b7d78efe.tar.bz2 iced-5df2a92f28be1d53d32d5b42a6645459b7d78efe.zip |
Force `Application::Message` to implement `Clone`
A `Message` should represent an application event (e.g. user
interactions, command results, subscription results...). Therefore, it
should always consist of pure, cloneable data.
Diffstat (limited to 'src')
-rw-r--r-- | src/application.rs | 2 | ||||
-rw-r--r-- | src/sandbox.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/application.rs b/src/application.rs index b3dae1b3..42c28f99 100644 --- a/src/application.rs +++ b/src/application.rs @@ -99,7 +99,7 @@ pub trait Application: Sized { type Executor: Executor; /// The type of __messages__ your [`Application`] will produce. - type Message: std::fmt::Debug + Send; + type Message: std::fmt::Debug + Clone + Send; /// The data needed to initialize your [`Application`]. type Flags; diff --git a/src/sandbox.rs b/src/sandbox.rs index 10b05a92..cb3cf624 100644 --- a/src/sandbox.rs +++ b/src/sandbox.rs @@ -88,7 +88,7 @@ use crate::{ /// ``` pub trait Sandbox { /// The type of __messages__ your [`Sandbox`] will produce. - type Message: std::fmt::Debug + Send; + type Message: std::fmt::Debug + Clone + Send; /// Initializes the [`Sandbox`]. /// |