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

Method resolve

libatomic/src/daemon/state.rs:331–348  ·  view source on GitHub ↗

Resolve a request's RepositoryRef to its handle. Unknown IDs fail closed (REPOSITORY_NOT_FOUND) — never a filesystem fallback.

(&self, reference: &RepositoryRef)

Source from the content-addressed store, hash-verified

329 /// Resolve a request's RepositoryRef to its handle. Unknown IDs fail
330 /// closed (REPOSITORY_NOT_FOUND) — never a filesystem fallback.
331 pub fn resolve(&self, reference: &RepositoryRef) -> Result<std::sync::Arc<RepoHandle>, Status> {
332 if reference.authority != "local" {
333 return Err(domain_status(
334 ErrorCode::InvalidArgument,
335 format!(
336 "this daemon serves the local authority; '{}' is not served here",
337 reference.authority
338 ),
339 ));
340 }
341 let repos = self.repos.lock().expect("repository registry");
342 repos.get(&reference.repository_id).cloned().ok_or_else(|| {
343 domain_status(
344 ErrorCode::RepositoryNotFound,
345 "repository is not registered with this daemon; resolve it by path first",
346 )
347 })
348 }
349
350 pub fn list(&self) -> Vec<std::sync::Arc<RepoHandle>> {
351 let repos = self.repos.lock().expect("repository registry");

Callers 15

startMethod · 0.45
mainFunction · 0.45
mainFunction · 0.45
executeFunction · 0.45
run.pyFile · 0.45
mainFunction · 0.45
mainFunction · 0.45
prepareFunction · 0.45
measureFunction · 0.45

Calls 3

domain_statusFunction · 0.85
lockMethod · 0.80
getMethod · 0.65