pub struct Component {
pub url: Option<String>,
pub decl: Option<Data>,
pub package: Option<Package>,
pub config_values: Option<Data>,
pub resolution_context: Option<Context>,
pub abi_revision: Option<u64>,
/* private fields */
}
Expand description
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
.
Fields§
§url: Option<String>
The resolved URL of the component. This is the canonical URL obtained by the component resolver after following redirects and resolving relative paths.
decl: Option<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: Option<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: Option<Data>
Binary representation of the component’s configuration values
(fuchsia.component.config.ValuesData
).
resolution_context: Option<Context>
The context used to resolve component_url
s 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
.
Resolver
s 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
.
abi_revision: Option<u64>
The target ABI revision of the resolved component.
Trait Implementations§
Source§impl Decode<Component, DefaultFuchsiaResourceDialect> for Component
impl Decode<Component, DefaultFuchsiaResourceDialect> for Component
Source§impl ResourceTypeMarker for Component
impl ResourceTypeMarker for Component
Source§type Borrowed<'a> = &'a mut Component
type Borrowed<'a> = &'a mut Component
Encode<Self>
type cheaply obtainable from &mut Self::Owned
. There are three cases: Read moreSource§fn take_or_borrow<'a>(
value: &'a mut <Self as TypeMarker>::Owned,
) -> Self::Borrowed<'a>
fn take_or_borrow<'a>( value: &'a mut <Self as TypeMarker>::Owned, ) -> Self::Borrowed<'a>
&mut Self::Owned
to Self::Borrowed
. For
HandleBased
types this is “take” (it returns an owned handle and
replaces value
with Handle::invalid
), and for all other types it is
“borrow” (just converts from one reference to another).Source§impl TypeMarker for Component
impl TypeMarker for Component
Source§fn inline_align(_context: Context) -> usize
fn inline_align(_context: Context) -> usize
Source§fn inline_size(_context: Context) -> usize
fn inline_size(_context: Context) -> usize
inline_align
.§fn encode_is_copy() -> bool
fn encode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and encoding requires no validation. When true, we can optimize
encoding arrays and vectors of Self::Owned
to a single memcpy. Read more§fn decode_is_copy() -> bool
fn decode_is_copy() -> bool
Self::Owned
matches the FIDL wire
format and decoding requires no validation. When true, we can optimize
decoding arrays and vectors of Self::Owned
to a single memcpy.