blob: 8e80f559850d52d23484776e9a02e8c226f7aadd [file] [log] [blame]
// Copyright 2018 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
library fuchsia.sys2;
using zx;
/// 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. (TODO: explain in more detail)
/// Note: The component manager is the only intended direct client of this
/// interface.
protocol ComponentResolver {
/// Resolves a component with the given URL.
/// `component_url` is the unescaped URL of the component to resolve.
/// If successful, returns `ZX_OK` and information about the component
/// that was resolved.
/// On failure, returns null `info` and...
/// - `ZX_ERR_INVALID_ARGS`: The component's URL was malformed.
/// - `ZX_ERR_NOT_FOUND`: The component does not exist.
/// - `ZX_ERR_UNAVAILABLE`: The resolver was unable to retrieve or parse
/// the component's resources.
Resolve(string component_url)
-> (zx.status status, Component component);