|
@@ -99,6 +99,7 @@ struct Ipc(Mutex<HashMap<IpcKey, Sender<std::result::Result<JsonValue, JsonValue
|
|
|
|
|
|
/// An empty [`Assets`] implementation.
|
|
|
pub struct NoopAsset {
|
|
|
+ assets: HashMap<&'static str, &'static [u8]>,
|
|
|
csp_hashes: Vec<CspHash<'static>>,
|
|
|
}
|
|
|
|
|
@@ -107,6 +108,10 @@ impl Assets for NoopAsset {
|
|
|
None
|
|
|
}
|
|
|
|
|
|
+ fn iter(&self) -> Box<dyn Iterator<Item = (&&str, &&[u8])> + '_> {
|
|
|
+ Box::new(self.assets.iter())
|
|
|
+ }
|
|
|
+
|
|
|
fn csp_hashes(&self, html_path: &AssetKey) -> Box<dyn Iterator<Item = CspHash<'_>> + '_> {
|
|
|
Box::new(self.csp_hashes.iter().copied())
|
|
|
}
|
|
@@ -115,6 +120,7 @@ impl Assets for NoopAsset {
|
|
|
/// Creates a new empty [`Assets`] implementation.
|
|
|
pub fn noop_assets() -> NoopAsset {
|
|
|
NoopAsset {
|
|
|
+ assets: Default::default(),
|
|
|
csp_hashes: Default::default(),
|
|
|
}
|
|
|
}
|