pub struct Incoming(/* private fields */);
Expand description
Implements access to the incoming namespace for a driver. It provides methods
for accessing incoming protocols and services by either their marker or proxy
types, and can be used as a [Directory
] with the functions in
[fuchsia_component::client
].
Implementations§
Source§impl Incoming
impl Incoming
Sourcepub fn protocol_marker<M: DiscoverableProtocolMarker>(
&self,
_marker: M,
) -> ProtocolConnector<'_, M::Proxy>
pub fn protocol_marker<M: DiscoverableProtocolMarker>( &self, _marker: M, ) -> ProtocolConnector<'_, M::Proxy>
Sourcepub fn protocol<P>(&self) -> ProtocolConnector<'_, P>
pub fn protocol<P>(&self) -> ProtocolConnector<'_, P>
Sourcepub fn service_marker<M: ServiceMarker>(
&self,
_marker: M,
) -> ServiceConnector<'_, M::Proxy>
pub fn service_marker<M: ServiceMarker>( &self, _marker: M, ) -> ServiceConnector<'_, M::Proxy>
Creates a connector to the given service’s default instance by its marker type. This can be
convenient when the compiler can’t deduce the [ServiceProxy
] type on its own.
See ServiceConnector
for more about what you can do with the connector.
§Example
ⓘ
let service = context.incoming.service_marker(fidl_fuchsia_hardware_i2c::ServiceMarker).connect()?;
let device = service.connect_to_device()?;
Sourcepub fn service<P>(&self) -> ServiceConnector<'_, P>
pub fn service<P>(&self) -> ServiceConnector<'_, P>
Creates a connector to the given service’s default instance by its proxy type. This can be
convenient when the compiler can deduce the [ServiceProxy
] type on its own.
See ServiceConnector
for more about what you can do with the connector.
§Example
ⓘ
struct MyProxies {
i2c_service: fidl_fuchsia_hardware_i2c::ServiceProxy,
}
let proxies = MyProxies {
i2c_service: context.incoming.service().connect()?;
};
Trait Implementations§
Source§impl AsRefDirectory for Incoming
impl AsRefDirectory for Incoming
Source§fn as_ref_directory(&self) -> &dyn Directory
fn as_ref_directory(&self) -> &dyn Directory
Get a [
Directory
] reference.Auto Trait Implementations§
impl Freeze for Incoming
impl RefUnwindSafe for Incoming
impl Send for Incoming
impl Sync for Incoming
impl Unpin for Incoming
impl UnwindSafe for Incoming
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
Mutably borrows from an owned value. Read more