pub struct Sources { /* private fields */ }
Expand description
Defines which capability source types are supported.
Implementations§
Source§impl Sources
impl Sources
Sourcepub fn new(capability: CapabilityTypeName) -> Self
pub fn new(capability: CapabilityTypeName) -> Self
Creates a new Sources
that does not allow any capability source types.
Sourcepub fn framework(self) -> Self
pub fn framework(self) -> Self
Allows framework capability sources of the given type (from: "framework"
in CML
).
Sourcepub fn capability(self) -> Self
pub fn capability(self) -> Self
Allows capability source types that originate from other capabilities (from: "#storage"
in
CML
).
Sourcepub fn collection(self) -> Self
pub fn collection(self) -> Self
Allows capability sources to originate from a collection.
Sourcepub fn namespace(self) -> Self
pub fn namespace(self) -> Self
Allows namespace capability source types, which are capabilities that are installed in component_manager’s incoming namespace.
Sourcepub fn builtin(self) -> Self
pub fn builtin(self) -> Self
Allows built-in capability source types (from: "parent"
in CML
where the parent component_instance is
component_manager).
Sourcepub fn framework_source(
&self,
moniker: &Moniker,
name: Name,
mapper: &mut dyn DebugRouteMapper,
) -> Result<InternalCapability, RoutingError>
pub fn framework_source( &self, moniker: &Moniker, name: Name, mapper: &mut dyn DebugRouteMapper, ) -> Result<InternalCapability, RoutingError>
Return the InternalCapability
representing this framework capability source, or
RoutingError::UnsupportedRouteSource
if unsupported.
Sourcepub fn capability_source(&self, moniker: &Moniker) -> Result<(), RoutingError>
pub fn capability_source(&self, moniker: &Moniker) -> Result<(), RoutingError>
Checks whether capability sources are supported, returning RoutingError::UnsupportedRouteSource
if they are not.
Sourcepub fn is_namespace_supported(&self) -> bool
pub fn is_namespace_supported(&self) -> bool
Checks whether namespace capability sources are supported.
Sourcepub fn find_namespace_source<V>(
&self,
moniker: impl Into<ExtendedMoniker>,
name: &Name,
capabilities: &[CapabilityDecl],
visitor: &mut V,
mapper: &mut dyn DebugRouteMapper,
) -> Result<Option<ComponentCapability>, RoutingError>where
V: CapabilityVisitor,
pub fn find_namespace_source<V>(
&self,
moniker: impl Into<ExtendedMoniker>,
name: &Name,
capabilities: &[CapabilityDecl],
visitor: &mut V,
mapper: &mut dyn DebugRouteMapper,
) -> Result<Option<ComponentCapability>, RoutingError>where
V: CapabilityVisitor,
Looks for a namespace capability in the list of capability sources.
If found, the declaration is visited by visitor
and the declaration is wrapped
in a ComponentCapability
.
Returns RoutingError::UnsupportedRouteSource
if namespace capabilities are unsupported.
Sourcepub fn find_builtin_source<V>(
&self,
moniker: impl Into<ExtendedMoniker>,
name: &Name,
capabilities: &[CapabilityDecl],
visitor: &mut V,
mapper: &mut dyn DebugRouteMapper,
) -> Result<Option<InternalCapability>, RoutingError>where
V: CapabilityVisitor,
pub fn find_builtin_source<V>(
&self,
moniker: impl Into<ExtendedMoniker>,
name: &Name,
capabilities: &[CapabilityDecl],
visitor: &mut V,
mapper: &mut dyn DebugRouteMapper,
) -> Result<Option<InternalCapability>, RoutingError>where
V: CapabilityVisitor,
Looks for a built-in capability in the list of capability sources.
If found, the capability’s name is wrapped in an InternalCapability
.
Returns RoutingError::UnsupportedRouteSource
if built-in capabilities are unsupported.
Sourcepub fn find_component_source<V>(
&self,
name: &Name,
moniker: &Moniker,
capabilities: &[CapabilityDecl],
visitor: &mut V,
mapper: &mut dyn DebugRouteMapper,
) -> Result<ComponentCapability, RoutingError>where
V: CapabilityVisitor,
pub fn find_component_source<V>(
&self,
name: &Name,
moniker: &Moniker,
capabilities: &[CapabilityDecl],
visitor: &mut V,
mapper: &mut dyn DebugRouteMapper,
) -> Result<ComponentCapability, RoutingError>where
V: CapabilityVisitor,
Looks for a component capability in the list of capability sources for the component instance
with moniker moniker
.
If found, the declaration is visited by visitor
and the declaration is wrapped
in a ComponentCapability
.
Returns RoutingError::UnsupportedRouteSource
if component capabilities are unsupported.
Trait Implementations§
Source§impl FidlIntoNative<Sources> for Sources
impl FidlIntoNative<Sources> for Sources
fn fidl_into_native(self) -> Sources
Source§impl NativeIntoFidl<Sources> for Sources
impl NativeIntoFidl<Sources> for Sources
fn native_into_fidl(self) -> Sources
impl StructuralPartialEq for Sources
Auto Trait Implementations§
impl Freeze for Sources
impl RefUnwindSafe for Sources
impl Send for Sources
impl Sync for Sources
impl Unpin for Sources
impl UnwindSafe for Sources
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)