Struct netdevice_client::client::Client
source · 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
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)