Google celebrates Hispanic Heritage Month. See how.

fuchsia.component.resolution

Added: 7

PROTOCOLS

Resolver

Defined in fuchsia.component.resolution/resolver.fidl

An interface for resolving a URL to a component.

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 "fuchsia-pkg://" scheme.

To use a resolver to resolve URLs within your realm, register it in your realm's manifest.

Note: The component manager is the only intended direct client of this interface.

Resolve

Resolves a component with the given absolute URL.

component_url is the unescaped URL of the component to resolve.

If successful, returns information about the component that was resolved.

On failure, returns a ResolverError error.

Request

NameType
component_url string[2083]

Response

NameType
result Resolver_Resolve_Result

ResolveWithContext

Resolves a component with the absolute or relative URL. If relative, the component will be resolved relative to the supplied context.

component_url is the unescaped URL of the component to resolve, the format of which can be either:

  • a fully-qualified absolute component URL; or
  • a subpackaged-component reference, prefixed by a URI relative path to its containing subpackage (for example, child_package#meta/some_component.cm)

context is the resolution_context of a previously-resolved Component, providing the context for resoving a relative URL.

Request

NameType
component_url string[2083]
context Context

Response

NameType
result Resolver_ResolveWithContext_Result

STRUCTS

Resolver_ResolveWithContext_Response resource

Defined in fuchsia.component.resolution/resolver.fidl

FieldTypeDescriptionDefault
component Component No default

Resolver_Resolve_Response resource

Defined in fuchsia.component.resolution/resolver.fidl

FieldTypeDescriptionDefault
component Component No default

ENUMS

ResolverError strict

Type: uint32

Defined in fuchsia.component.resolution/resolver.fidl

The possible error conditions returned by ComponentResolver.

NameValueDescription
1

An unexpected error occurred.

2

A general IO error occurred.

3

The component URL was malformed.

4

The repository specified in the URL is unsupported.

5

The component manifest was not found.

6

The component's package was not found.

7

Insufficient space on device to store component's package.

8

The component is temporarily unavailable.

9

The component manifest could not be parsed or it contained invalid configuration.

10

The component specifies configuration fields but the values were not found.

TABLES

Component resource

Defined in fuchsia.component.resolution/component.fidl

A component is a unit of executable software.

This object provides the component's declaration, access to its package's content, and relevant metadata as resolved fuchsia.component.resolution.Resolver.

OrdinalFieldTypeDescription
url string[2083]

The resolved URL of the component. This is the canonical URL obtained by the component resolver after following redirects and resolving relative paths.

decl fuchsia.mem/Data

Binary representation of the component's declaration (fuchsia.component.decl.Component). This information is typically obtained from the component's manifest or generated by the component resolver.

package Package

The package that contains the component. By convention, the component's package is mapped to "/pkg" in its namespace at runtime.

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 resolved_url. This mechanism is used for web applications.

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.

config_values fuchsia.mem/Data

Binary representation of the component's configuration values (fuchsia.component.config.ValuesData).

resolution_context Context

The context used to resolve component_urls relative to this component. Pass this value to Resolver::ResolveWithContext() when resolving a component URL that may be relative to this Component.

The resolution_context is an opaque value (from the perspective of component resolution) that is provided by a component Resolver to save with a parent Component.

Resolvers that can resolve relative path component URLs, via ResolveWithContext, should return a resolution_context from both Resolve and ResolveWithContext. Relative path component URLs can only be resolved via ResolveWithContext, which requires a valid resolution Context.

Package resource

Defined in fuchsia.component.resolution/package.fidl

A package is a signed collection of immutable files.

This object provides access to a package's content and relevant metadata.

OrdinalFieldTypeDescription
url string[2083]

The URL of the package itself.

directory fuchsia.io/Directory

The package's content directory.

UNIONS

Resolver_ResolveWithContext_Result strict resource

Defined in fuchsia.component.resolution/resolver.fidl

OrdinalVariantTypeDescription
response Resolver_ResolveWithContext_Response
err ResolverError

Resolver_Resolve_Result strict resource

Defined in fuchsia.component.resolution/resolver.fidl

OrdinalVariantTypeDescription
response Resolver_Resolve_Response
err ResolverError

CONSTANTS

NameValueTypeDescription
MAX_COMPONENT_URL_LENGTH 2083 uint32

Max length of component URL.

MAX_RESOLUTION_CONTEXT_LENGTH 8192 uint32

The maximum number of bytes for a Context.

TYPE ALIASES

NameValueDescription
Context vector[MAX_RESOLUTION_CONTEXT_LENGTH]

A byte array that persists a value used by the target Resolver to locate and resolve a component by relative path (for example, by a subpackage name).