pub struct PageRef<'a> {
kva: Kva,
_lt: PhantomData<&'a ()>,
}Expand description
A reference of a memory page.
PageRef represents a borrowed reference to a kernel virtual address
(Kva) that maps to a memory.
§Usage
This struct is useful for safely accessing mapped kernel pages without
requiring ownership transfers. The lifetime parameter 'a ensures that
the reference does not outlive the memory it points to.
Fields§
§kva: Kva§_lt: PhantomData<&'a ()>Implementations§
Source§impl PageRef<'_>
impl PageRef<'_>
Sourcepub fn inner(&self) -> &[u8]
pub fn inner(&self) -> &[u8]
Get a reference to the underlying slice of the page (read-only).
This method allows access to the contents of the page as a byte slice. The caller can read from the page’s memory, but cannot modify it.
§Returns
- A reference to the byte slice representing the contents of the page.
§Example:
let slice = page.inner(); // Get read-only access to the page's contentSourcepub fn inner_mut(&mut self) -> &mut [u8]
pub fn inner_mut(&mut self) -> &mut [u8]
Get a mutable reference to the underlying slice of the page.
This method allows modification of the contents of the page as a byte slice. The caller can read from and write to the page’s memory.
§Returns
- A mutable reference to the byte slice representing the contents of the page.
§Example:
let slice = page.inner_mut();