pub struct RingSlot<'r, const N: usize, const BYTES: usize> { /* private fields */ }Expand description
An exclusive lease on one StaticLendRing slot: fill it via
buf_mut, then publish it as a zero-copy
frame slice. Dropping it without publishing releases the lease (the slot was
reserved for a capture that never happened).
Implementations§
Source§impl<const N: usize, const BYTES: usize> RingSlot<'_, N, BYTES>
impl<const N: usize, const BYTES: usize> RingSlot<'_, N, BYTES>
Sourcepub fn buf_mut(&mut self) -> &mut [u8] ⓘ
pub fn buf_mut(&mut self) -> &mut [u8] ⓘ
The slot’s backing bytes, for the capture (DMA target / test fill) to write.
Sourcepub unsafe fn publish(self, len: usize) -> SystemSlice
pub unsafe fn publish(self, len: usize) -> SystemSlice
Publish the first len captured bytes as a zero-copy SystemSlice that
borrows this slot; the slot is reclaimed for reuse when the returned slice
(the frame carrying it) is dropped downstream.
§Safety
The ring must outlive the returned SystemSlice and any frame holding it.
On a static / StaticCell ring this is automatic; a stack ring must be
kept alive until the pipeline drains.
Trait Implementations§
Auto Trait Implementations§
impl<'r, const N: usize, const BYTES: usize> !RefUnwindSafe for RingSlot<'r, N, BYTES>
impl<'r, const N: usize, const BYTES: usize> !Send for RingSlot<'r, N, BYTES>
impl<'r, const N: usize, const BYTES: usize> !Sync for RingSlot<'r, N, BYTES>
impl<'r, const N: usize, const BYTES: usize> !UnwindSafe for RingSlot<'r, N, BYTES>
impl<'r, const N: usize, const BYTES: usize> Freeze for RingSlot<'r, N, BYTES>
impl<'r, const N: usize, const BYTES: usize> Unpin for RingSlot<'r, N, BYTES>
impl<'r, const N: usize, const BYTES: usize> UnsafeUnpin for RingSlot<'r, N, BYTES>
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