pub struct PortProxy { /* private fields */ }
Implementations§
Source§impl PortProxy
impl PortProxy
Sourcepub fn take_event_stream(&self) -> PortEventStream
pub fn take_event_stream(&self) -> PortEventStream
Get a Stream of events from the remote end of the protocol.
§Panics
Panics if the event stream was already taken.
Sourcepub fn get_state(
&self,
) -> QueryResponseFut<InternalState, DefaultFuchsiaResourceDialect>
pub fn get_state( &self, ) -> QueryResponseFut<InternalState, DefaultFuchsiaResourceDialect>
Gets the port internal state.
- response
state
a snapshot of the port’s internal state.
Sourcepub fn watch_state(
&self,
) -> QueryResponseFut<InternalState, DefaultFuchsiaResourceDialect>
pub fn watch_state( &self, ) -> QueryResponseFut<InternalState, DefaultFuchsiaResourceDialect>
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,
) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
pub fn set_online( &self, online: bool, ) -> QueryResponseFut<(), DefaultFuchsiaResourceDialect>
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 PortProxyInterface for PortProxy
impl PortProxyInterface for PortProxy
type GetStateResponseFut = QueryResponseFut<InternalState>
type WatchStateResponseFut = QueryResponseFut<InternalState>
type SetOnlineResponseFut = QueryResponseFut<()>
fn get_state(&self) -> Self::GetStateResponseFut
fn watch_state(&self) -> Self::WatchStateResponseFut
fn set_online(&self, online: bool) -> Self::SetOnlineResponseFut
fn get_port(&self, port: ServerEnd<PortMarker>) -> Result<(), Error>
fn remove(&self) -> Result<(), Error>
Source§impl Proxy for PortProxy
impl Proxy for PortProxy
Source§type Protocol = PortMarker
type Protocol = PortMarker
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 PortProxy
impl !RefUnwindSafe for PortProxy
impl Send for PortProxy
impl Sync for PortProxy
impl Unpin for PortProxy
impl !UnwindSafe for PortProxy
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)