Same as [`Wizer::snapshot`], except for components.
(
&self,
mut cx: ComponentContext<'_>,
instance: &mut impl ComponentInstanceState,
)
| 33 | |
| 34 | /// Same as [`Wizer::snapshot`], except for components. |
| 35 | pub async fn snapshot_component( |
| 36 | &self, |
| 37 | mut cx: ComponentContext<'_>, |
| 38 | instance: &mut impl ComponentInstanceState, |
| 39 | ) -> Result<Vec<u8>> { |
| 40 | if !self.func_renames.is_empty() { |
| 41 | bail!("components do not support renaming functions"); |
| 42 | } |
| 43 | |
| 44 | let snapshot = snapshot::snapshot(&cx, instance).await; |
| 45 | let rewritten_wasm = self.rewrite_component(&mut cx, &snapshot); |
| 46 | self.debug_assert_valid_wasm(&rewritten_wasm, "rewritten component"); |
| 47 | |
| 48 | Ok(rewritten_wasm) |
| 49 | } |
| 50 | } |
| 51 | |
| 52 | /// Trait representing the ability to invoke functions on a component to learn |
no test coverage detected