Run the specified closure, passing it mutable access to the store. This function is one of the main building blocks of the [`Accessor`] type. This yields synchronous, blocking, access to the store via an [`Access`]. The [`Access`] implements [`AsContextMut`] in addition to providing the ability to access `D` via [`Access::get`]. Note that the `fun` here is given only temporary access to the store
(&self, fun: impl FnOnce(Access<'_, T, D>) -> R)
| 456 | /// then this function will panic. It is up to the embedder to ensure that |
| 457 | /// this does not happen. |
| 458 | pub fn with<R>(&self, fun: impl FnOnce(Access<'_, T, D>) -> R) -> R { |
| 459 | tls::get(|vmstore| { |
| 460 | fun(Access { |
| 461 | store: self.token.as_context_mut(vmstore), |
| 462 | get_data: self.get_data, |
| 463 | }) |
| 464 | }) |
| 465 | } |
| 466 | |
| 467 | /// Returns the getter this accessor is using to project from `T` into |
| 468 | /// `D::Data`. |