pub struct PortWatcherProxy { /* private fields */ }
Implementations§
source§impl PortWatcherProxy
impl PortWatcherProxy
sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.network/PortWatcher.
sourcepub fn take_event_stream(&self) -> PortWatcherEventStream
pub fn take_event_stream(&self) -> PortWatcherEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
sourcepub fn watch(&self) -> QueryResponseFut<DevicePortEvent>
pub fn watch(&self) -> QueryResponseFut<DevicePortEvent>
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 Clone for PortWatcherProxy
impl Clone for PortWatcherProxy
source§fn clone(&self) -> PortWatcherProxy
fn clone(&self) -> PortWatcherProxy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for PortWatcherProxy
impl Debug for PortWatcherProxy
source§impl PortWatcherProxyInterface for PortWatcherProxy
impl PortWatcherProxyInterface for PortWatcherProxy
type WatchResponseFut = QueryResponseFut<DevicePortEvent>
fn watch(&self) -> Self::WatchResponseFut
source§impl Proxy for PortWatcherProxy
impl Proxy for PortWatcherProxy
§type Protocol = PortWatcherMarker
type Protocol = PortWatcherMarker
Proxy
controls.source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Auto Trait Implementations§
impl Freeze for PortWatcherProxy
impl !RefUnwindSafe for PortWatcherProxy
impl Send for PortWatcherProxy
impl Sync for PortWatcherProxy
impl Unpin for PortWatcherProxy
impl !UnwindSafe for PortWatcherProxy
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)