pub struct PortProxy { /* private fields */ }
Implementations§
Source§impl PortProxy
impl PortProxy
Sourcepub fn new(channel: AsyncChannel) -> Self
pub fn new(channel: AsyncChannel) -> Self
Create a new Proxy for fuchsia.hardware.network/Port.
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_info(
&self,
) -> QueryResponseFut<PortInfo, DefaultFuchsiaResourceDialect>
pub fn get_info( &self, ) -> QueryResponseFut<PortInfo, DefaultFuchsiaResourceDialect>
Obtain information about port.
- response
info
port information.
Sourcepub fn get_status(
&self,
) -> QueryResponseFut<PortStatus, DefaultFuchsiaResourceDialect>
pub fn get_status( &self, ) -> QueryResponseFut<PortStatus, DefaultFuchsiaResourceDialect>
Obtain the operating port status.
- response
status
snapshot of port’s current status.
Sourcepub fn get_status_watcher(
&self,
watcher: ServerEnd<StatusWatcherMarker>,
buffer: u32,
) -> Result<(), Error>
pub fn get_status_watcher( &self, watcher: ServerEnd<StatusWatcherMarker>, buffer: u32, ) -> Result<(), Error>
Connects to a [StatusWatcher
] to observe port status changes.
- request
watcher
handle to the status watcher. - request
buffer
the number of status changes that the client requests to be stored byStatusWatcher
. Values are capped atMAX_STATUS_BUFFER
. A value of 0 or 1 causes theStatusWatcher
to not keep any buffers on status changed. Clients that need to observe all changes to status (as opposed to only the current state) are encouraged to set a buffer value larger than 1, so that all edges can be observed. IfStatusWatcher
’s internal queue is filled and new status changes occur, the oldest samples will be dropped to make room for new ones.
Sourcepub fn get_mac(&self, mac: ServerEnd<MacAddressingMarker>) -> Result<(), Error>
pub fn get_mac(&self, mac: ServerEnd<MacAddressingMarker>) -> Result<(), Error>
Connects to a [MacAddressing
] associated with the port.
- request
mac
mac handle. Closed withZX_ERR_NOT_SUPPORTED
if this port does not support mac addressing.
Sourcepub fn get_device(&self, device: ServerEnd<DeviceMarker>) -> Result<(), Error>
pub fn get_device(&self, device: ServerEnd<DeviceMarker>) -> Result<(), Error>
Connects to the [Device
] this port belongs to.
- request
device
grants access to the parent device.
Sourcepub fn clone(&self, port: ServerEnd<PortMarker>) -> Result<(), Error>
pub fn clone(&self, port: ServerEnd<PortMarker>) -> Result<(), Error>
Establishes a new connection to this port.
- request
port
the server end for the new connection.
Sourcepub fn get_counters(
&self,
) -> QueryResponseFut<PortGetCountersResponse, DefaultFuchsiaResourceDialect>
pub fn get_counters( &self, ) -> QueryResponseFut<PortGetCountersResponse, DefaultFuchsiaResourceDialect>
Retrieves a snapshot of traffic counters on this port.
Sourcepub fn get_diagnostics(
&self,
diagnostics: ServerEnd<DiagnosticsMarker>,
) -> Result<(), Error>
pub fn get_diagnostics( &self, diagnostics: ServerEnd<DiagnosticsMarker>, ) -> Result<(), Error>
Grants access to [Diagnostics
] for this port.
- request
diagnostics
grants access to diagnostics information.
Trait Implementations§
Source§impl PortProxyInterface for PortProxy
impl PortProxyInterface for PortProxy
type GetInfoResponseFut = QueryResponseFut<PortInfo>
type GetStatusResponseFut = QueryResponseFut<PortStatus>
type GetCountersResponseFut = QueryResponseFut<PortGetCountersResponse>
fn get_info(&self) -> Self::GetInfoResponseFut
fn get_status(&self) -> Self::GetStatusResponseFut
fn get_status_watcher( &self, watcher: ServerEnd<StatusWatcherMarker>, buffer: u32, ) -> Result<(), Error>
fn get_mac(&self, mac: ServerEnd<MacAddressingMarker>) -> Result<(), Error>
fn get_device(&self, device: ServerEnd<DeviceMarker>) -> Result<(), Error>
fn clone(&self, port: ServerEnd<PortMarker>) -> Result<(), Error>
fn get_counters(&self) -> Self::GetCountersResponseFut
fn get_diagnostics( &self, diagnostics: ServerEnd<DiagnosticsMarker>, ) -> Result<(), Error>
Source§impl Proxy for PortProxy
impl Proxy for PortProxy
Source§type Protocol = PortMarker
type Protocol = PortMarker
The protocol which this
Proxy
controls.Source§fn from_channel(inner: AsyncChannel) -> Self
fn from_channel(inner: AsyncChannel) -> Self
Create a proxy over the given channel.
Source§fn into_channel(self) -> Result<AsyncChannel, Self>
fn into_channel(self) -> Result<AsyncChannel, Self>
Attempt to convert the proxy back into a channel. Read more
Source§fn as_channel(&self) -> &AsyncChannel
fn as_channel(&self) -> &AsyncChannel
Get a reference to the proxy’s underlying channel. Read more
§fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
fn into_client_end(self) -> Result<ClientEnd<Self::Protocol>, Self>
Attempt to convert the proxy back into a client end. Read more
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
Mutably borrows from an owned value. Read more
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> ProxyHasClient for Twhere
T: Proxy,
impl<T> ProxyHasClient for Twhere
T: Proxy,
§fn client(&self) -> Result<ZirconClient, Infallible>
fn client(&self) -> Result<ZirconClient, Infallible>
Get a “client” for this proxy. This is just an object which has methods
for a few common handle creation operations.