#[repr(C)]pub struct AvailableRing<'a> {
size: usize,
pub flags: &'a mut u16,
pub idx: &'a mut u16,
pub ring: &'a mut [u16],
pub used_event: &'a mut u16,
}
Expand description
Available ring structure
This structure is wrapped around the RawAvailableRing
structure.
It provides a safe interface to access the available ring entries.
Fields§
§size: usize
§flags: &'a mut u16
§idx: &'a mut u16
§ring: &'a mut [u16]
§used_event: &'a mut u16
Implementations§
Source§impl<'a> AvailableRing<'a>
impl<'a> AvailableRing<'a>
Sourcepub unsafe fn new(size: usize, ptr: *mut RawAvailableRing) -> Self
pub unsafe fn new(size: usize, ptr: *mut RawAvailableRing) -> Self
Create a new AvailableRing
instance
This function creates a new AvailableRing
instance from a raw pointer to a RawAvailableRing
.
§Safety
This function is unsafe because it dereferences raw pointers and assumes that the memory layout is correct.
The caller must ensure that the pointer is valid and points to a properly initialized RawAvailableRing
.
§Arguments
size
- The size of the ring.ptr
- A raw pointer to aRawAvailableRing
.
§Returns
AvailableRing
- A new AvailableRing
instance.