MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / context

Method context

atomic-repository/src/repository/content.rs:1170–1192  ·  view source on GitHub ↗
(
        &self,
    )

Source from the content-addressed store, hash-verified

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
1195pub(super) fn retrieve_span_bounded_if_present<T, C>(

Callers 2

render_if_presentMethod · 0.45
primeMethod · 0.45

Calls 3

as_refMethod · 0.80
getMethod · 0.65
cloneMethod · 0.45

Tested by

no test coverage detected