Struct netdevice_client::session::Session
source · pub struct Session { /* private fields */ }
Expand description
A session between network device client and driver.
Implementations§
source§impl Session
impl Session
sourcepub async fn new(
device: &DeviceProxy,
name: &str,
config: Config
) -> Result<(Self, Task)>
pub async fn new( device: &DeviceProxy, name: &str, config: Config ) -> Result<(Self, Task)>
Creates a new session with the given name
and config
.
sourcepub fn send(&self, buffer: Buffer<Tx>) -> Result<()>
pub fn send(&self, buffer: Buffer<Tx>) -> Result<()>
Sends a Buffer
to the network device in this session.
sourcepub async fn recv(&self) -> Result<Buffer<Rx>>
pub async fn recv(&self) -> Result<Buffer<Rx>>
Receives a Buffer
from the network device in this session.
sourcepub async fn alloc_tx_buffer(&self, num_bytes: usize) -> Result<Buffer<Tx>>
pub async fn alloc_tx_buffer(&self, num_bytes: usize) -> Result<Buffer<Tx>>
Allocates a Buffer
that may later be queued to the network device.
The returned buffer will have at least num_bytes
as size.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Session
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
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