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 connect_protocol<T: Connect>(&self) -> Result<T, Status>
pub fn connect_protocol<T: Connect>(&self) -> Result<T, Status>
Connects to the protocol in the service instance’s path in the incoming namespace. Logs and
returns a [Status::CONNECTION_REFUSED
] if the service instance couldn’t be opened.
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
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
§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> IntoAny for T
impl<T> IntoAny for T
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more