pub struct BufferOwner<P: BufferProvider, M: MemOps> { /* private fields */ }Expand description
The owner of a mapped buffer, ensuring its lifetime.
Holds an OwnedAlloc and provides direct access to the underlying
shared memory via MemOps::as_slice. Implements AsRef<[u8]> so it
can be used with Bytes::from_owner for
zero-copy Bytes backed by shared memory.
When dropped, the allocation is returned to the pool.
Trait Implementations§
Source§impl<P: BufferProvider, M: MemOps> AsRef<[u8]> for BufferOwner<P, M>
impl<P: BufferProvider, M: MemOps> AsRef<[u8]> for BufferOwner<P, M>
Auto Trait Implementations§
impl<P, M> Freeze for BufferOwner<P, M>
impl<P, M> RefUnwindSafe for BufferOwner<P, M>where
M: RefUnwindSafe,
P: RefUnwindSafe,
impl<P, M> Send for BufferOwner<P, M>
impl<P, M> Sync for BufferOwner<P, M>
impl<P, M> Unpin for BufferOwner<P, M>
impl<P, M> UnsafeUnpin for BufferOwner<P, M>where
M: UnsafeUnpin,
P: UnsafeUnpin,
impl<P, M> UnwindSafe for BufferOwner<P, M>where
M: UnwindSafe,
P: UnwindSafe,
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