MCPcopy Create free account
hub / github.com/hashintel/hash / resolve_absolute

Method resolve_absolute

libs/@local/hashql/core/src/module/namespace.rs:251–276  ·  view source on GitHub ↗

Resolves a path from the absolute scope. # Errors Returns a `ResolutionError` if the path cannot be resolved or if multiple matches are found.

(
        &self,
        query: impl IntoIterator<Item = Symbol<'heap>>,
        ResolveOptions { universe, mode }: ResolveOptions,
    )

Source from the content-addressed store, hash-verified

249 ///
250 /// Returns a `ResolutionError` if the path cannot be resolved or if multiple matches are found.
251 fn resolve_absolute(
252 &self,
253 query: impl IntoIterator<Item = Symbol<'heap>>,
254 ResolveOptions { universe, mode }: ResolveOptions,
255 ) -> Result<Reference<'heap>, ResolutionError<'heap>> {
256 debug_assert_eq!(mode, ResolutionMode::Absolute);
257
258 let resolver = Resolver {
259 registry: self.registry,
260 options: ResolverOptions {
261 mode: ResolverMode::Single(universe),
262 suggestions: true,
263 },
264 };
265
266 let mut iter = resolver.resolve_absolute(query)?;
267 let item = iter.next().unwrap_or_else(|| {
268 unreachable!("ResolveIter guarantees at least one item is returned")
269 });
270
271 if iter.next().is_some() {
272 Err(ResolutionError::Ambiguous(item))
273 } else {
274 Ok(item)
275 }
276 }
277
278 /// Resolves a path using the specified resolution mode.
279 ///

Callers 4

import_absoluteMethod · 0.45
resolveMethod · 0.45
resolve_absolute_valueFunction · 0.45
resolve_absolute_typeFunction · 0.45

Calls 3

ErrInterface · 0.85
OkInterface · 0.85
nextMethod · 0.45

Tested by 2

resolve_absolute_valueFunction · 0.36
resolve_absolute_typeFunction · 0.36