pub enum PortRequest {
GetState {
responder: PortGetStateResponder,
},
WatchState {
responder: PortWatchStateResponder,
},
SetOnline {
online: bool,
responder: PortSetOnlineResponder,
},
GetPort {
port: ServerEnd<PortMarker>,
control_handle: PortControlHandle,
},
Remove {
control_handle: PortControlHandle,
},
}
Expand description
A logical port attached to a [fuchsia.net.tun/Device
].
This protocol encodes the underlying object’s lifetime in both directions; the underlying object is alive iff both ends of the protocol are open. That is:
- Closing the client end causes the object to be destroyed.
- Observing a closure of the server end indicates the object no longer exists.
Variants§
GetState
Gets the port internal state.
- response
state
a snapshot of the port’s internal state.
Fields
responder: PortGetStateResponder
WatchState
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.
Fields
responder: PortWatchStateResponder
SetOnline
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.
GetPort
Connects to the underlying device port.
- request
port
grants access to the device port.
Remove
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.
Fields
control_handle: PortControlHandle
Implementations§
Source§impl PortRequest
impl PortRequest
pub fn into_get_state(self) -> Option<PortGetStateResponder>
pub fn into_watch_state(self) -> Option<PortWatchStateResponder>
pub fn into_set_online(self) -> Option<(bool, PortSetOnlineResponder)>
pub fn into_get_port(self) -> Option<(ServerEnd<PortMarker>, PortControlHandle)>
pub fn into_remove(self) -> Option<PortControlHandle>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL