pub struct PortWatcherSynchronousProxy { /* private fields */ }
Implementations§
Source§impl PortWatcherSynchronousProxy
impl PortWatcherSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<PortWatcherEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<PortWatcherEvent, 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(
&self,
___deadline: MonotonicInstant,
) -> Result<DevicePortEvent, Error>
pub fn watch( &self, ___deadline: MonotonicInstant, ) -> Result<DevicePortEvent, Error>
Get the next port event.
The first N calls return [DevicePortEvent.existing
] where N is the
number of ports present on the device at the time of the watcher’s
creation. The next call returns [DevicePortEvent.idle
] to indicate the
end of existing ports. Subsequent calls block until a port is added
([DevicePortEvent.added
]) or removed ([DevicePortEvent.removed
]).
The server closes the PortWatcher
channel with ZX_ERR_CANCELED
if
the number of unread events reaches a server-selected limit that is at
least two times MAX_PORTS
. Clients are encouraged to maintain a
hanging call to Watch
at all times to avoid triggering this condition.
- response
event
next port event.
Trait Implementations§
Source§impl Debug for PortWatcherSynchronousProxy
impl Debug for PortWatcherSynchronousProxy
Source§impl SynchronousProxy for PortWatcherSynchronousProxy
impl SynchronousProxy for PortWatcherSynchronousProxy
Source§type Proxy = PortWatcherProxy
type Proxy = PortWatcherProxy
Source§type Protocol = PortWatcherMarker
type Protocol = PortWatcherMarker
Proxy
controls.