pub struct PooledBuffer {
pub id: u64,
pub data: Vec<u8>,
pub desc: BufferDesc,
pub in_use: bool,
}Expand description
A buffer managed by the pool with an associated unique ID.
Fields§
§id: u64Unique identifier for this buffer within the pool.
data: Vec<u8>Raw buffer data.
desc: BufferDescDescriptor for this buffer.
in_use: boolWhether this buffer is currently in use.
Implementations§
Source§impl PooledBuffer
impl PooledBuffer
Sourcepub fn new(id: u64, desc: BufferDesc) -> Self
pub fn new(id: u64, desc: BufferDesc) -> Self
Creates a new PooledBuffer.
Sourcepub fn available_size(&self) -> usize
pub fn available_size(&self) -> usize
Returns the number of bytes available (equal to the buffer size).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PooledBuffer
impl RefUnwindSafe for PooledBuffer
impl Send for PooledBuffer
impl Sync for PooledBuffer
impl Unpin for PooledBuffer
impl UnsafeUnpin for PooledBuffer
impl UnwindSafe for PooledBuffer
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