blob: ad5e5898da3536d0a282ec0f8507cf176eb40896 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.component.resolution
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## Resolver {#Resolver}
*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=19)*
<p>An interface for resolving a URL to a component.</p>
<p>This interface is implemented by components that provide support
for loading components with a particular URL scheme. For example,
the Fuchsia package component resolver exposes a service with this
interface to resolve component URLs using the &quot;fuchsia-pkg://&quot; scheme.</p>
<p>To use a resolver to resolve URLs within your realm, register it
in your realm's manifest.</p>
<p>Note: The component manager is the only intended direct client of this
interface.</p>
### Resolve {#Resolver.Resolve}
<p>Resolves a component with the given absolute URL.</p>
<p><code>component_url</code> is the unescaped URL of the component to resolve.</p>
<p>If successful, returns information about the component
that was resolved.</p>
<p>On failure, returns a <code>ResolverError</code> error.</p>
#### Request {#Resolver.Resolve_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>component_url</code></td>
<td>
<code>string[2083]</code>
</td>
</tr>
</table>
#### Response {#Resolver.Resolve_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Resolver_Resolve_Result'>Resolver_Resolve_Result</a></code>
</td>
</tr>
</table>
### ResolveWithContext {#Resolver.ResolveWithContext}
<p>Resolves a component with the absolute or relative URL. If relative, the
component will be resolved relative to the supplied <code>context</code>.</p>
<p><code>component_url</code> is the unescaped URL of the component to resolve, the
format of which can be either:</p>
<ul>
<li>a fully-qualified absolute component URL; or</li>
<li>a subpackaged-component reference, prefixed by a URI relative
path to its containing subpackage (for example,
<code>child_package#meta/some_component.cm</code>)</li>
</ul>
<p><code>context</code> is the <code>resolution_context</code> of a previously-resolved
<code>Component</code>, providing the context for resoving a relative URL.</p>
#### Request {#Resolver.ResolveWithContext_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>component_url</code></td>
<td>
<code>string[2083]</code>
</td>
</tr>
<tr>
<td><code>context</code></td>
<td>
<code><a class='link' href='#Context'>Context</a></code>
</td>
</tr>
</table>
#### Response {#Resolver.ResolveWithContext_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#Resolver_ResolveWithContext_Result'>Resolver_ResolveWithContext_Result</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### Context {#Context data-text="Context"}
*Defined in [fuchsia.component.resolution/component.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/component.fidl;l=77)*
<p>A component resolution context, used when resolving component URLs relative
to another component. The context is stored in a byte array that persists a
value used by the target <code>Resolver</code> to locate and resolve a component by
relative path (for example, by a subpackage name).</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 9</span></div>
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Context.bytes">
<td><code>bytes</code></td>
<td>
<code>vector&lt;uint8&gt;[8192]</code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### Resolver_ResolveWithContext_Response [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Resolver_ResolveWithContext_Response data-text="Resolver_ResolveWithContext_Response"}
*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=50)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Resolver_ResolveWithContext_Response.component">
<td><code>component</code></td>
<td>
<code><a class='link' href='#Component'>Component</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
### Resolver_Resolve_Response [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Resolver_Resolve_Response data-text="Resolver_Resolve_Response"}
*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=30)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="Resolver_Resolve_Response.component">
<td><code>component</code></td>
<td>
<code><a class='link' href='#Component'>Component</a></code>
</td>
<td></td>
<td>No default</td>
</tr>
</table>
## **ENUMS**
### ResolverError [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#ResolverError data-text="ResolverError"}
Type: <code>uint32</code>
*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=57)*
<p>The possible error conditions returned by ComponentResolver.</p>
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="ResolverError.INTERNAL">
<td><h3 id="ResolverError.INTERNAL" class="add-link hide-from-toc">INTERNAL</h3></td>
<td><code>1</code></td>
<td><p>An unexpected error occurred.</p>
</td>
</tr>
<tr id="ResolverError.IO">
<td><h3 id="ResolverError.IO" class="add-link hide-from-toc">IO</h3></td>
<td><code>2</code></td>
<td><p>A general IO error occurred.</p>
</td>
</tr>
<tr id="ResolverError.INVALID_ARGS">
<td><h3 id="ResolverError.INVALID_ARGS" class="add-link hide-from-toc">INVALID_ARGS</h3></td>
<td><code>3</code></td>
<td><p>The component URL was malformed.</p>
</td>
</tr>
<tr id="ResolverError.NOT_SUPPORTED">
<td><h3 id="ResolverError.NOT_SUPPORTED" class="add-link hide-from-toc">NOT_SUPPORTED</h3></td>
<td><code>4</code></td>
<td><p>The repository specified in the URL is unsupported.</p>
</td>
</tr>
<tr id="ResolverError.MANIFEST_NOT_FOUND">
<td><h3 id="ResolverError.MANIFEST_NOT_FOUND" class="add-link hide-from-toc">MANIFEST_NOT_FOUND</h3></td>
<td><code>5</code></td>
<td><p>The component manifest was not found.</p>
</td>
</tr>
<tr id="ResolverError.PACKAGE_NOT_FOUND">
<td><h3 id="ResolverError.PACKAGE_NOT_FOUND" class="add-link hide-from-toc">PACKAGE_NOT_FOUND</h3></td>
<td><code>6</code></td>
<td><p>The component's package was not found.</p>
</td>
</tr>
<tr id="ResolverError.NO_SPACE">
<td><h3 id="ResolverError.NO_SPACE" class="add-link hide-from-toc">NO_SPACE</h3></td>
<td><code>7</code></td>
<td><p>Insufficient space on device to store component's package.</p>
</td>
</tr>
<tr id="ResolverError.RESOURCE_UNAVAILABLE">
<td><h3 id="ResolverError.RESOURCE_UNAVAILABLE" class="add-link hide-from-toc">RESOURCE_UNAVAILABLE</h3></td>
<td><code>8</code></td>
<td><p>The component is temporarily unavailable.</p>
</td>
</tr>
<tr id="ResolverError.INVALID_MANIFEST">
<td><h3 id="ResolverError.INVALID_MANIFEST" class="add-link hide-from-toc">INVALID_MANIFEST</h3></td>
<td><code>9</code></td>
<td><p>The component manifest could not be parsed or it contained invalid configuration.</p>
</td>
</tr>
<tr id="ResolverError.CONFIG_VALUES_NOT_FOUND">
<td><h3 id="ResolverError.CONFIG_VALUES_NOT_FOUND" class="add-link hide-from-toc">CONFIG_VALUES_NOT_FOUND</h3></td>
<td><code>10</code></td>
<td><p>The component specifies configuration fields but the values were not found.</p>
</td>
</tr>
</table>
## **TABLES**
### Component [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Component data-text="Component"}
*Defined in [fuchsia.component.resolution/component.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/component.fidl;l=12)*
<p>A component is a unit of executable software.</p>
<p>This object provides the component's declaration, access to its package's
content, and relevant metadata as resolved <code>fuchsia.component.resolution.Resolver</code>.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Component.url">
<td><h3 id="Component.url" class="add-link hide-from-toc">1</h3></td>
<td><code>url</code></td>
<td>
<code>string[2083]</code>
</td>
<td><p>The resolved URL of the component.
This is the canonical URL obtained by the component resolver after
following redirects and resolving relative paths.</p>
</td>
</tr>
<tr id="Component.decl">
<td><h3 id="Component.decl" class="add-link hide-from-toc">2</h3></td>
<td><code>decl</code></td>
<td>
<code><a class='link' href='../fuchsia.mem/'>fuchsia.mem</a>/<a class='link' href='../fuchsia.mem/#Data'>Data</a></code>
</td>
<td><p>Binary representation of the component's declaration (<code>fuchsia.component.decl.Component</code>).
This information is typically obtained from the component's manifest
or generated by the component resolver.</p>
</td>
</tr>
<tr id="Component.package">
<td><h3 id="Component.package" class="add-link hide-from-toc">3</h3></td>
<td><code>package</code></td>
<td>
<code><a class='link' href='#Package'>Package</a></code>
</td>
<td><p>The package that contains the component.
By convention, the component's package is mapped to &quot;/pkg&quot; in its
namespace at runtime.</p>
<p>This is null if the component is not represented as a package.
In that case, it is the runner's responsibility to load the component's
resource from the <code>resolved_url</code>. This mechanism is used for web
applications.</p>
<p>Most runners, including but not limited to the builtin ELF runner,
require the package's directory connection to have OPEN_RIGHT_EXECUTABLE
rights in order to run the resolved component.</p>
</td>
</tr>
<tr id="Component.config_values">
<td><h3 id="Component.config_values" class="add-link hide-from-toc">4</h3></td>
<td><code>config_values</code></td>
<td>
<code><a class='link' href='../fuchsia.mem/'>fuchsia.mem</a>/<a class='link' href='../fuchsia.mem/#Data'>Data</a></code>
</td>
<td><p>Binary representation of the component's configuration values
(<code>fuchsia.component.config.ValuesData</code>).</p>
</td>
</tr>
<tr id="Component.resolution_context">
<td><h3 id="Component.resolution_context" class="add-link hide-from-toc">5</h3></td>
<td><code>resolution_context</code></td>
<td>
<code><a class='link' href='#Context'>Context</a></code>
</td>
<td><p>The context used to resolve <code>component_url</code>s relative to this
component. Pass this value to <code>Resolver::ResolveWithContext()</code> when
resolving a component URL that <em>may</em> be relative to this <code>Component</code>.</p>
<p>The <code>resolution_context</code> is an opaque value (from the perspective of
component resolution) that is provided by a component <code>Resolver</code> to save
with a parent <code>Component</code>.</p>
<p><code>Resolver</code>s that can resolve relative path component URLs, via
<code>ResolveWithContext</code>, should return a <code>resolution_context</code> from both
<code>Resolve</code> and <code>ResolveWithContext</code>. Relative path component URLs can
only be resolved via <code>ResolveWithContext</code>, which requires a valid
resolution <code>Context</code>.</p>
</td>
</tr>
</table>
### Package [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Package data-text="Package"}
*Defined in [fuchsia.component.resolution/package.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/package.fidl;l=14)*
<p>A package is a signed collection of immutable files.</p>
<p>This object provides access to a package's content and relevant metadata.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Package.url">
<td><h3 id="Package.url" class="add-link hide-from-toc">1</h3></td>
<td><code>url</code></td>
<td>
<code>string[2083]</code>
</td>
<td><p>The URL of the package itself.</p>
</td>
</tr>
<tr id="Package.directory">
<td><h3 id="Package.directory" class="add-link hide-from-toc">2</h3></td>
<td><code>directory</code></td>
<td>
<code><a class='link' href='../fuchsia.io/'>fuchsia.io</a>/<a class='link' href='../fuchsia.io/#Directory'>Directory</a></code>
</td>
<td><p>The package's content directory.</p>
</td>
</tr>
</table>
## **UNIONS**
### Resolver_ResolveWithContext_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Resolver_ResolveWithContext_Result data-text="Resolver_ResolveWithContext_Result"}
*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=50)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Resolver_ResolveWithContext_Result.response">
<td><h3 id="Resolver_ResolveWithContext_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Resolver_ResolveWithContext_Response'>Resolver_ResolveWithContext_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Resolver_ResolveWithContext_Result.err">
<td><h3 id="Resolver_ResolveWithContext_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#ResolverError'>ResolverError</a></code>
</td>
<td></td>
</tr>
</table>
### Resolver_Resolve_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} [resource](/fuchsia-src/reference/fidl/language/language.md#value-vs-resource){:.fidl-attribute} {#Resolver_Resolve_Result data-text="Resolver_Resolve_Result"}
*Defined in [fuchsia.component.resolution/resolver.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/resolver.fidl;l=30)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Resolver_Resolve_Result.response">
<td><h3 id="Resolver_Resolve_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#Resolver_Resolve_Response'>Resolver_Resolve_Response</a></code>
</td>
<td></td>
</tr>
<tr id="Resolver_Resolve_Result.err">
<td><h3 id="Resolver_Resolve_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='#ResolverError'>ResolverError</a></code>
</td>
<td></td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="MAX_COMPONENT_URL_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/package.fidl;l=9">MAX_COMPONENT_URL_LENGTH</a></td>
<td>
<code>2083</code>
</td>
<td><code>uint32</code></td>
<td><p>Max length of component URL.</p>
</td>
</tr>
<tr id="MAX_RESOLUTION_CONTEXT_SIZE">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.component.resolution/component.fidl;l=68">MAX_RESOLUTION_CONTEXT_SIZE</a></td>
<td>
<code>8192</code>
</td>
<td><code>uint32</code></td>
<td><p>The maximum number of bytes for a <code>Context</code>.</p>
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 9</span></div></td>
</tr>
</table>