Skip to main content

TxBufferAllocator

Trait TxBufferAllocator 

Source
pub trait TxBufferAllocator<Buffer> {
    type Error;

    // Required method
    fn alloc(
        &mut self,
        len: usize,
        queue_len: usize,
    ) -> Result<Buffer, Self::Error>;
}
Expand description

Allocator for Tx buffers to be stored in Tx queue.

Required Associated Types§

Source

type Error

Error for allocating a Tx buffer.

Required Methods§

Source

fn alloc(&mut self, len: usize, queue_len: usize) -> Result<Buffer, Self::Error>

Allocate Tx buffer. This method is only called while the TX queue is locked. queue_len is the current length of the TX queue.

Implementations on Foreign Types§

Source§

impl TxBufferAllocator<NeverBuffer> for ()

Source§

type Error = ()

Source§

fn alloc(&mut self, _len: usize, _qlen: usize) -> Result<NeverBuffer, ()>

Implementors§