pub struct UseProtocol {
pub source: Option<Ref>,
pub source_name: Option<String>,
pub target_path: Option<String>,
pub dependency_type: Option<DependencyType>,
pub availability: Option<Availability>,
pub source_dictionary: Option<String>,
pub numbered_handle: Option<u8>,
/* private fields */
}Expand description
Declares a protocol used by a component, which was offered to it.
A protocol is a service with a single instance, provided by a single FIDL protocol.
Fields§
§source: Option<Ref>(Required) The provider of the protocol relative to the component
itself. Must be parent, framework, debug, capability or child.
source_name: Option<String>(Required) Name identifying the protocol, by which it was presented to this component.
target_path: Option<String>(Required) The path where the capability should be installed in the component’s namespace.
Must be an absolute path starting with /.
dependency_type: Option<DependencyType>(Required) The dependency type this use represents.
A component which offers a capability to a child from itself and uses a
capability from the same child, must mark the dependency as weak. A
weak dependency implies that the capability may become unavailable at
any point. Taking a strong dependency on a child’s capability will
cause this the child to shut down before its parent. When using a weak
dependency, the parent shuts down before the child.
availability: Option<Availability>(Optional, defaults to REQUIRED) The availability of this capability.
If set to required, the component is likely to malfunction if this
capability is not provided. If set to optional, the component can
handle the capability’s absence.
source_dictionary: Option<String>(Optional) Path in a dictionary provided by source which contains source_name.
If this field is absent, source_name identifies a capability directly routed
by source. If set, source_name identifies a capability nested inside this
dictionary.
numbered_handle: Option<u8>(Optional) A processargs ordinal (zircon/processargs.h) by which a channel to this protocol will be delivered to the component’s processargs.
Must be a valid processargs ordinal defined in zircon/processargs.h.
If this is set, we still require target_path to also be set, although we could relax this
restriction in the future.
Trait Implementations§
Source§impl Clone for UseProtocol
impl Clone for UseProtocol
Source§fn clone(&self) -> UseProtocol
fn clone(&self) -> UseProtocol
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for UseProtocol
impl Debug for UseProtocol
Source§impl<D> Decode<UseProtocol, D> for UseProtocolwhere
D: ResourceDialect,
impl<D> Decode<UseProtocol, D> for UseProtocolwhere
D: ResourceDialect,
Source§fn new_empty() -> UseProtocol
fn new_empty() -> UseProtocol
Self. The specific value does not matter,
since it will be overwritten by decode.Source§impl Default for UseProtocol
impl Default for UseProtocol
Source§fn default() -> UseProtocol
fn default() -> UseProtocol
Source§impl<D> Encode<UseProtocol, D> for &UseProtocolwhere
D: ResourceDialect,
impl<D> Encode<UseProtocol, D> for &UseProtocolwhere
D: ResourceDialect,
Source§impl PartialEq for UseProtocol
impl PartialEq for UseProtocol
Source§impl TypeMarker for UseProtocol
impl TypeMarker for UseProtocol
Source§type Owned = UseProtocol
type Owned = UseProtocol
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.Source§impl ValueTypeMarker for UseProtocol
impl ValueTypeMarker for UseProtocol
Source§type Borrowed<'a> = &'a UseProtocol
type Borrowed<'a> = &'a UseProtocol
Encode<Self>
type cheaply obtainable from &Self::Owned. There are three cases: Read moreSource§fn borrow(
value: &<UseProtocol as TypeMarker>::Owned,
) -> <UseProtocol as ValueTypeMarker>::Borrowed<'_>
fn borrow( value: &<UseProtocol as TypeMarker>::Owned, ) -> <UseProtocol as ValueTypeMarker>::Borrowed<'_>
&Self::Owned to Self::Borrowed.