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 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, FDomainResourceDialect> for Component
impl Decode<Component, FDomainResourceDialect> 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
.Source§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 moreSource§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.impl Standalone<FDomainResourceDialect> for Component
impl StructuralPartialEq for Component
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnwindSafe for Component
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> InstanceFromServiceTransport<T> for T
impl<T> InstanceFromServiceTransport<T> for T
§fn from_service_transport(handle: T) -> T
fn from_service_transport(handle: T) -> T
T
to [Self
]