pub struct DeviceSynchronousProxy { /* private fields */ }Implementations§
Source§impl DeviceSynchronousProxy
impl DeviceSynchronousProxy
pub fn new(channel: Channel) -> Self
pub fn into_channel(self) -> Channel
Sourcepub fn wait_for_event(
&self,
deadline: MonotonicInstant,
) -> Result<DeviceEvent, Error>
pub fn wait_for_event( &self, deadline: MonotonicInstant, ) -> Result<DeviceEvent, 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 write_frame(
&self,
frame: &Frame,
___deadline: MonotonicInstant,
) -> Result<DeviceWriteFrameResult, Error>
pub fn write_frame( &self, frame: &Frame, ___deadline: MonotonicInstant, ) -> Result<DeviceWriteFrameResult, Error>
Writes a frame to the device (data coming from network-end).
If the device was created with the
[fuchsia.net.tun/DeviceConfig.blocking] option set to true, calls to
WriteFrame block until there is one buffer available to fulfill the
request.
- request
frameinbound frame data and metadata.
- error
ZX_ERR_NOT_FOUNDif [Frame.port] references an unknown port. - error
ZX_ERR_INVALID_ARGSifframeis invalid. - error
ZX_ERR_BAD_STATEif the device is offline. - error
ZX_ERR_NO_RESOURCESif more than [fuchsia.net.tun/MAX_PENDING_OPERATIONS] calls toWriteFrameare pending. - error
ZX_ERR_SHOULD_WAITifblockingis set tofalseand there are no buffers available to fulfill the request.
Sourcepub fn read_frame(
&self,
___deadline: MonotonicInstant,
) -> Result<DeviceReadFrameResult, Error>
pub fn read_frame( &self, ___deadline: MonotonicInstant, ) -> Result<DeviceReadFrameResult, Error>
Gets the next frame from the device (data coming from host-end).
If the device was created with the
[fuchsia.net.tun/DeviceConfig.blocking] option set to true, calls to
ReadFrame block until there is a frame available to be read.
- response
frameoutbound frame data and metadata.
- error
ZX_ERR_NO_RESOURCESif more than [fuchsia.net.tun/MAX_PENDING_OPERATIONS] calls toReadFrameare pending. - error
ZX_ERR_SHOULD_WAITifblockingis set tofalseand there are no frames to be read.
Sourcepub fn get_signals(
&self,
___deadline: MonotonicInstant,
) -> Result<EventPair, Error>
pub fn get_signals( &self, ___deadline: MonotonicInstant, ) -> Result<EventPair, Error>
Retrieves signals eventpair.
- response
signalsan eventpair that is signalled withSIGNAL_READABLEandSIGNAL_WRITABLEwhen read and write buffers are available, respectively.
Sourcepub fn add_port(
&self,
config: &DevicePortConfig,
port: ServerEnd<PortMarker>,
) -> Result<(), Error>
pub fn add_port( &self, config: &DevicePortConfig, port: ServerEnd<PortMarker>, ) -> Result<(), Error>
Creates a new port on this device.
- request
confignew port configuration. - request
portgrants control over the port. Closed with an epitaph ifconfigis not valid.
Sourcepub fn get_device(&self, device: ServerEnd<DeviceMarker>) -> Result<(), Error>
pub fn get_device(&self, device: ServerEnd<DeviceMarker>) -> Result<(), Error>
Connects to the underlying device endpoint.
- request
devicedevice handle.
Sourcepub fn delegate_rx_lease(&self, lease: DelegatedRxLease) -> Result<(), Error>
pub fn delegate_rx_lease(&self, lease: DelegatedRxLease) -> Result<(), Error>
Delegates an rx lease through the tun device.
See documentation on [fuchsia.hardware.network/DelegatedRxLease] for
proper usage.
Trait Implementations§
Source§impl Debug for DeviceSynchronousProxy
impl Debug for DeviceSynchronousProxy
Source§impl From<Channel> for DeviceSynchronousProxy
Available on Fuchsia only.
impl From<Channel> for DeviceSynchronousProxy
Source§impl From<DeviceSynchronousProxy> for Handle
Available on Fuchsia only.
impl From<DeviceSynchronousProxy> for Handle
Source§fn from(value: DeviceSynchronousProxy) -> Self
fn from(value: DeviceSynchronousProxy) -> Self
Source§impl FromClient for DeviceSynchronousProxy
Available on Fuchsia only.
impl FromClient for DeviceSynchronousProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Source§fn from_client(value: ClientEnd<DeviceMarker>) -> Self
fn from_client(value: ClientEnd<DeviceMarker>) -> Self
Source§impl SynchronousProxy for DeviceSynchronousProxy
Available on Fuchsia only.
impl SynchronousProxy for DeviceSynchronousProxy
Source§type Proxy = DeviceProxy
type Proxy = DeviceProxy
Source§type Protocol = DeviceMarker
type Protocol = DeviceMarker
Proxy controls.