|
@@ -15,7 +15,7 @@ use tauri_utils::assets::{Assets, EmbeddedAssets};
|
|
pub const ISOLATION_IFRAME_SRC_DOMAIN: &str = "localhost";
|
|
pub const ISOLATION_IFRAME_SRC_DOMAIN: &str = "localhost";
|
|
|
|
|
|
/// An application pattern.
|
|
/// An application pattern.
|
|
-#[derive(Debug, Clone)]
|
|
|
|
|
|
+#[derive(Debug)]
|
|
pub enum Pattern<A: Assets = EmbeddedAssets> {
|
|
pub enum Pattern<A: Assets = EmbeddedAssets> {
|
|
/// The brownfield pattern.
|
|
/// The brownfield pattern.
|
|
Brownfield(PhantomData<A>),
|
|
Brownfield(PhantomData<A>),
|
|
@@ -38,6 +38,26 @@ pub enum Pattern<A: Assets = EmbeddedAssets> {
|
|
},
|
|
},
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+impl<A: Assets> Clone for Pattern<A> {
|
|
|
|
+ fn clone(&self) -> Self {
|
|
|
|
+ match self {
|
|
|
|
+ Self::Brownfield(a) => Self::Brownfield(*a),
|
|
|
|
+ #[cfg(feature = "isolation")]
|
|
|
|
+ Self::Isolation {
|
|
|
|
+ assets,
|
|
|
|
+ schema,
|
|
|
|
+ key,
|
|
|
|
+ crypto_keys,
|
|
|
|
+ } => Self::Isolation {
|
|
|
|
+ assets: assets.clone(),
|
|
|
|
+ schema: schema.clone(),
|
|
|
|
+ key: key.clone(),
|
|
|
|
+ crypto_keys: crypto_keys.clone(),
|
|
|
|
+ },
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
/// The shape of the JavaScript Pattern config
|
|
/// The shape of the JavaScript Pattern config
|
|
#[derive(Debug, Serialize)]
|
|
#[derive(Debug, Serialize)]
|
|
#[serde(rename_all = "lowercase", tag = "pattern")]
|
|
#[serde(rename_all = "lowercase", tag = "pattern")]
|