(
&self,
)
| 1168 | } |
| 1169 | |
| 1170 | fn context( |
| 1171 | &self, |
| 1172 | ) -> Result<&atomic_core::pristine::span_patch_storage::SpanRenderContext<'a, T>, RepositoryError> |
| 1173 | { |
| 1174 | let stored = match self.context.get() { |
| 1175 | Some(stored) => stored, |
| 1176 | None => { |
| 1177 | // Built outside the cell: initialising it in place would park |
| 1178 | // every other caller behind a build that may be waiting for |
| 1179 | // one of them. |
| 1180 | let built = atomic_core::pristine::span_patch_storage::SpanRenderContext::new( |
| 1181 | self.txn, |
| 1182 | self.store, |
| 1183 | self.visibility, |
| 1184 | ) |
| 1185 | .map_err(|error| error.to_string()); |
| 1186 | self.context.get_or_init(|| built) |
| 1187 | } |
| 1188 | }; |
| 1189 | stored |
| 1190 | .as_ref() |
| 1191 | .map_err(|error| RepositoryError::Database(error.clone())) |
| 1192 | } |
| 1193 | } |
| 1194 | |
| 1195 | pub(super) fn retrieve_span_bounded_if_present<T, C>( |
no test coverage detected