(
self,
f: impl for<'gc> FnOnce(&'gc Mutation<'gc>, Root<'gc, R>) -> Result<Root<'gc, R2>, E>,
)
| 183 | |
| 184 | #[inline] |
| 185 | pub fn try_map_root<R2, E>( |
| 186 | self, |
| 187 | f: impl for<'gc> FnOnce(&'gc Mutation<'gc>, Root<'gc, R>) -> Result<Root<'gc, R2>, E>, |
| 188 | ) -> Result<Arena<R2>, E> |
| 189 | where |
| 190 | R2: for<'a> Rootable<'a>, |
| 191 | for<'a> Root<'a, R2>: Sized, |
| 192 | { |
| 193 | self.context.root_barrier(); |
| 194 | let new_root: Root<'static, R2> = unsafe { |
| 195 | let mc: &'static Mutation<'_> = &*(self.context.mutation_context() as *const _); |
| 196 | f(mc, self.root)? |
| 197 | }; |
| 198 | Ok(Arena { |
| 199 | context: self.context, |
| 200 | root: new_root, |
| 201 | }) |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | impl<R> Arena<R> |
nothing calls this directly
no test coverage detected