Skip to main content

resolve_context_provider

Function resolve_context_provider 

Source
pub fn resolve_context_provider<'a>(
    catalog: &'a [RegisteredContextProviderDescriptor],
    requested: Option<&ContextProviderId>,
) -> Result<&'a RegisteredContextProviderDescriptor, ContextProviderLookupError>
Expand description

Resolve one context-provider request against the loaded catalog. EXACT-SCOPE, FAIL-CLOSED matching — the same discipline as super::lifecycle::validate_manifest_deferred and crate::orchestration::validate_user_authorizable_model: no partial, prefix, or fuzzy matches, and no arbitrary tie-breaking.

  • requested = Some(id) — Ok iff EXACTLY ONE catalog entry declares that exact local id; zero matches fail NotRegistered, two or more (the same id declared by multiple installed extensions) fail Ambiguous.
  • requested = None — the request names no explicit provider: Ok iff the whole catalog holds EXACTLY ONE descriptor; an empty catalog fails NotRegistered and overlapping declarations fail Ambiguous.

Pure slice read: never spawns, never touches lease state.