(
self,
f: impl for<'gc> FnOnce(&'gc Mutation<'gc>, Root<'gc, R>) -> Root<'gc, R2>,
)
| 163 | |
| 164 | #[inline] |
| 165 | pub fn map_root<R2>( |
| 166 | self, |
| 167 | f: impl for<'gc> FnOnce(&'gc Mutation<'gc>, Root<'gc, R>) -> Root<'gc, R2>, |
| 168 | ) -> Arena<R2> |
| 169 | where |
| 170 | R2: for<'a> Rootable<'a>, |
| 171 | for<'a> Root<'a, R2>: Sized, |
| 172 | { |
| 173 | self.context.root_barrier(); |
| 174 | let new_root: Root<'static, R2> = unsafe { |
| 175 | let mc: &'static Mutation<'_> = &*(self.context.mutation_context() as *const _); |
| 176 | f(mc, self.root) |
| 177 | }; |
| 178 | Arena { |
| 179 | context: self.context, |
| 180 | root: new_root, |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | #[inline] |
| 185 | pub fn try_map_root<R2, E>( |
nothing calls this directly
no test coverage detected