pub struct Client { /* private fields */ }Expand description
A client that communicates with a network device to send and receive packets.
Implementations§
Source§impl Client
impl Client
Sourcepub fn new(device: DeviceProxy) -> Self
pub fn new(device: DeviceProxy) -> Self
Creates a new network device client for the netdev::DeviceProxy.
Sourcepub fn connect_port(&self, port: Port) -> Result<PortProxy>
pub fn connect_port(&self, port: Port) -> Result<PortProxy>
Connects to the specified port.
Sourcepub fn connect_port_server_end(
&self,
port: Port,
server_end: ServerEnd<PortMarker>,
) -> Result<()>
pub fn connect_port_server_end( &self, port: Port, server_end: ServerEnd<PortMarker>, ) -> Result<()>
Connects to the specified port with the provided server_end.
Sourcepub async fn device_info(&self) -> Result<DeviceInfo>
pub async fn device_info(&self) -> Result<DeviceInfo>
Retrieves information about the underlying network device.
Sourcepub fn port_status_stream(
&self,
port: Port,
) -> Result<impl Stream<Item = Result<PortStatus>> + Unpin>
pub fn port_status_stream( &self, port: Port, ) -> Result<impl Stream<Item = Result<PortStatus>> + Unpin>
Gets a [Stream] of PortStatus for status changes from the device.
A sensible nonzero default buffer size will be used. It is encouraged to use this function.
Sourcepub fn port_status_stream_with_buffer_size(
&self,
port: Port,
buffer: u32,
) -> Result<impl Stream<Item = Result<PortStatus>> + Unpin>
pub fn port_status_stream_with_buffer_size( &self, port: Port, buffer: u32, ) -> Result<impl Stream<Item = Result<PortStatus>> + Unpin>
Gets a [Stream] of PortStatus for status changes from the device.
Sourcepub async fn wait_online(&self, port: Port) -> Result<PortStatus>
pub async fn wait_online(&self, port: Port) -> Result<PortStatus>
Waits for port to become online and report the PortStatus.
Sourcepub fn device_port_event_stream(
&self,
) -> Result<impl Stream<Item = Result<DevicePortEvent>> + Unpin>
pub fn device_port_event_stream( &self, ) -> Result<impl Stream<Item = Result<DevicePortEvent>> + Unpin>
Gets a [Stream] of DevicePortEvent to monitor port changes from the device.
Sourcepub async fn new_session(
&self,
name: &str,
config: Config,
) -> Result<(Session, Task)>
pub async fn new_session( &self, name: &str, config: Config, ) -> Result<(Session, Task)>
Creates a new session with the given the given name and config.
Sourcepub async fn new_session_with_derivable_config(
&self,
name: &str,
config: DerivableConfig,
) -> Result<(Session, Task)>
pub async fn new_session_with_derivable_config( &self, name: &str, config: DerivableConfig, ) -> Result<(Session, Task)>
Creates a session using the higher level DerivableConfig instead of
a raw Config.