pub struct PortSynchronousProxy { /* private fields */ }
Implementations§
Source§impl PortSynchronousProxy
impl PortSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<PortEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<PortEvent, 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 get_state(
&self,
___deadline: MonotonicInstant,
) -> Result<InternalState, Error>
pub fn get_state( &self, ___deadline: MonotonicInstant, ) -> Result<InternalState, Error>
Gets the port internal state.
- response
state
a snapshot of the port’s internal state.
Sourcepub fn watch_state(
&self,
___deadline: MonotonicInstant,
) -> Result<InternalState, Error>
pub fn watch_state( &self, ___deadline: MonotonicInstant, ) -> Result<InternalState, Error>
Observes changes to internal state.
The first call always returns the current internal state, subsequent
calls block until the internal state differs from the last one returned
from a WatchState
call.
WatchState
does not provide full history of internal state changes. It
is possible that intermediary internal state changes are missed in
between WatchState
calls.
- response
state
the latest observed port internal state.
Sourcepub fn set_online(
&self,
online: bool,
___deadline: MonotonicInstant,
) -> Result<(), Error>
pub fn set_online( &self, online: bool, ___deadline: MonotonicInstant, ) -> Result<(), Error>
Sets the port’s online status.
The online status is visible through
[fuchsia.hardware.network/Port.GetStatus
]. Once SetOnline
returns,
the status reported through GetStatus
is guaranteed to be the one
passed to SetOnline
.
- request
online
desired port online state.
Sourcepub fn get_port(&self, port: ServerEnd<PortMarker>) -> Result<(), Error>
pub fn get_port(&self, port: ServerEnd<PortMarker>) -> Result<(), Error>
Connects to the underlying device port.
- request
port
grants access to the device port.
Sourcepub fn remove(&self) -> Result<(), Error>
pub fn remove(&self) -> Result<(), Error>
Triggers port removal.
The client end will be closed once the server has completely cleaned up all resources related to the port. This is equivalent to simply dropping the client end, but provides callers with a signal of when removal is complete, allowing port identifiers to be reused, for example.
Trait Implementations§
Source§impl Debug for PortSynchronousProxy
impl Debug for PortSynchronousProxy
Source§impl SynchronousProxy for PortSynchronousProxy
impl SynchronousProxy for PortSynchronousProxy
Source§type Protocol = PortMarker
type Protocol = PortMarker
Proxy
controls.