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

Method resolve

libs/@local/hashql/core/src/module/mod.rs:177–205  ·  view source on GitHub ↗

Resolves a path to an item in the registry. # Errors Returns a `ResolutionError` if: - The path cannot be resolved to any item - The path resolves to multiple items (ambiguous resolution) - Any part of the path fails to resolve correctly

(
        &self,
        path: impl IntoIterator<Item = Symbol<'heap>>,
        universe: Universe,
    )

Source from the content-addressed store, hash-verified

175 /// - The path resolves to multiple items (ambiguous resolution)
176 /// - Any part of the path fails to resolve correctly
177 pub fn resolve(
178 &self,
179 path: impl IntoIterator<Item = Symbol<'heap>>,
180 universe: Universe,
181 ) -> Result<Item<'heap>, ResolutionError<'heap>> {
182 let resolver = Resolver {
183 registry: self,
184 options: ResolverOptions {
185 mode: ResolverMode::Single(universe),
186 suggestions: true,
187 },
188 };
189
190 let mut iter = resolver.resolve_absolute(path)?;
191 let item = iter.next().unwrap_or_else(|| {
192 unreachable!("ResolveIter guarantees at least one item is returned")
193 });
194
195 if iter.next().is_some() {
196 Err(ResolutionError::Ambiguous(item))
197 } else {
198 match item {
199 Reference::Binding(_) => {
200 unreachable!("Absolute path cannot point to a local binding")
201 }
202 Reference::Item(item) => Ok(item),
203 }
204 }
205 }
206
207 /// Attempts to resolve a path to an item in the registry.
208 ///

Callers 15

webpack.config.jsFile · 0.45
main.tsFile · 0.45
bundleFunction · 0.45
index.tsFile · 0.45
createEmailTransporterFunction · 0.45
resolveInvocationFunction · 0.45
checkPermissionsOnEntityFunction · 0.45
panda.config.tsFile · 0.45

Calls 4

ErrInterface · 0.85
OkInterface · 0.85
resolve_absoluteMethod · 0.45
nextMethod · 0.45

Tested by 6

recordingExporterFunction · 0.36
flushWorkerSetupFunction · 0.36
createMockFrameAccessorsFunction · 0.36
WrapperFunction · 0.36
WrapperFunction · 0.36
createFakeTransportFunction · 0.36