Struct fuchsia_component::client::Service
source · pub struct Service<S> { /* private fields */ }
Expand description
A service from an incoming namespace’s /svc
directory.
Implementations§
source§impl<S: ServiceMarker> Service<S>
impl<S: ServiceMarker> Service<S>
sourcepub fn from_service_dir_proxy(dir: DirectoryProxy, _marker: S) -> Self
pub fn from_service_dir_proxy(dir: DirectoryProxy, _marker: S) -> Self
Returns a new Service
that waits for instances to appear in
the given service directory, probably opened by open_service
sourcepub fn open(marker: S) -> Result<Self, Error>
pub fn open(marker: S) -> Result<Self, Error>
Returns a new Service
from the process’s incoming service namespace.
sourcepub fn open_from_dir(
svc_dir: impl AsRefDirectory,
marker: S,
) -> Result<Self, Error>
pub fn open_from_dir( svc_dir: impl AsRefDirectory, marker: S, ) -> Result<Self, Error>
Returns a new Service
that is in the given directory.
sourcepub fn open_from_dir_prefix(
dir: impl AsRefDirectory,
prefix: impl AsRef<str>,
marker: S,
) -> Result<Self, Error>
pub fn open_from_dir_prefix( dir: impl AsRefDirectory, prefix: impl AsRef<str>, marker: S, ) -> Result<Self, Error>
sourcepub fn connect_to_instance(
&self,
name: impl AsRef<str>,
) -> Result<S::Proxy, Error>
pub fn connect_to_instance( &self, name: impl AsRef<str>, ) -> Result<S::Proxy, Error>
Connects to the named instance without waiting for it to appear. You should only use this
after the instance name has been returned by the Self::watch
stream, or if the
instance is statically routed so component manager will lazily load it.
sourcepub async fn watch(&self) -> Result<ServiceInstanceStream<'_, S>, Error>
pub async fn watch(&self) -> Result<ServiceInstanceStream<'_, S>, Error>
Returns an async stream of service instances that are enumerated within this service directory.
sourcepub async fn watch_for_any(&self) -> Result<ServiceInstance<'_, S>, Error>
pub async fn watch_for_any(&self) -> Result<ServiceInstance<'_, S>, Error>
Asynchronously returns the first service instance available within this service directory.
Trait Implementations§
source§impl<S> From<DirectoryProxy> for Service<S>where
S: Default,
impl<S> From<DirectoryProxy> for Service<S>where
S: Default,
Returns a new Service
that waits for instances to appear in
the given service directory, probably opened by open_service