pub struct ClientSynchronousProxy { /* private fields */ }
Implementations§
Source§impl ClientSynchronousProxy
impl ClientSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<ClientEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<ClientEvent, Error>
Waits until an event arrives and returns it. It is safe for other threads to make concurrent requests while waiting for an event.
Sourcepub fn watch_services(
&self,
uuids: &[Uuid],
___deadline: MonotonicInstant,
) -> Result<(Vec<ServiceInfo>, Vec<Handle>), Error>
pub fn watch_services( &self, uuids: &[Uuid], ___deadline: MonotonicInstant, ) -> Result<(Vec<ServiceInfo>, Vec<Handle>), Error>
Enumerates services found on the peer that this Client represents.
Results can be filtered by specifying a list of UUIDs in uuids
. This
method follows the hanging get pattern. On the initial request, a
complete snapshot will be returned. Subsequent calls with the same set
of uuids
receive a response only when one or more services have been
added, modified, or removed from the entries reported since the most
recent call. Calls with new values of uuids
will reset the filter and
receive a complete snapshot.
Handles may be reused across services, so a handle may be in both
updated
and removed
. For this reason, it is recommended to process
removed services before updated services.
To further interact with services, clients must obtain a RemoteService protocol by calling ConnectToService().
- request
uuids
the UUID allowlist. If empty, all services will be returned.
- response
updated
the services that have been added or modified since WatchServices() was last called. The returned ServiceInfo tables will contain only basic information about each service and thecharacteristics
andincludes
fields will be null. If a service has been added/modified and then removed since the last call, it will only be present inremoved
, notupdated
. If concluded due to a new call with a newuuids
value,updated
will be empty. - response
removed
the handles of the services that have been removed since the last call to WatchServices().
Sourcepub fn connect_to_service(
&self,
handle: &ServiceHandle,
service: ServerEnd<RemoteServiceMarker>,
) -> Result<(), Error>
pub fn connect_to_service( &self, handle: &ServiceHandle, service: ServerEnd<RemoteServiceMarker>, ) -> Result<(), Error>
Connects the RemoteService with the given identifier. Only 1 connection per service is allowed.
service
will be closed on error, with an epitaph that provides a
reason.
- error Returns a
ZX_ERR_INVALID_ARGS
ifhandle
is invalid. - error Returns a
ZX_ERR_NOT_FOUND
if the service is not found. - error Returns a
ZX_ERR_CONNECTION_RESET
if the service is removed. - error Returns a
ZX_ERR_NOT_CONNECTED
if the peer disconnects. - error Returns a
ZX_ERR_ALREADY_EXISTS
if the service is already connected.
Trait Implementations§
Source§impl Debug for ClientSynchronousProxy
impl Debug for ClientSynchronousProxy
Source§impl SynchronousProxy for ClientSynchronousProxy
impl SynchronousProxy for ClientSynchronousProxy
Source§type Proxy = ClientProxy
type Proxy = ClientProxy
Source§type Protocol = ClientMarker
type Protocol = ClientMarker
Proxy
controls.