Skip to main content

LuaPage

Struct LuaPage 

Source
pub struct LuaPage { /* private fields */ }
Expand description

Non-owning identity of a VM allocation page.

§Safety model for unsafe methods

The page and its allocation must remain live. Block sizes, offsets, and traversal metadata must match the page class; page-list or allocator mutation can invalidate the handle and every pointer derived from it.

Implementations§

Source§

impl LuaPage

Source

pub const unsafe fn from_raw(raw: NonNull<RawLuaPage>) -> Self

Source

pub fn data_ptr(&self) -> *const u8

Source

pub fn data_ptr_mut(&self) -> *mut u8

Source

pub unsafe fn block(&self, offset: i32) -> *mut u8

Returns a block address at offset bytes from the page data.

§Safety

offset must be non-negative, aligned for the page’s block layout, and identify a complete block within this page’s allocation.

Source

pub fn page_blocks(&self) -> i32

Source

pub unsafe fn metadata_slot(block: *mut u8) -> *mut *mut u8

§Safety

block must address a live allocator block whose leading storage is a pointer-sized metadata slot.

§Safety

block must address a live GC block large enough to contain the collector free-list link at GCO_LINK_OFFSET.

Source

pub unsafe fn gco_walk(&self) -> (GcoPageWalk, i32)

Source

pub unsafe fn next_page(&self) -> Option<LuaPage>

luaM_getnextpage

Source

pub unsafe fn visit_page( &self, context: *mut (), visitor: unsafe fn(*mut (), LuaPage, GcObject) -> bool, )

luaM_visitpage

Trait Implementations§

Source§

impl AsRef<LuaPage> for LuaPage

Source§

fn as_ref(&self) -> &LuaPage

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for LuaPage

Source§

fn clone(&self) -> LuaPage

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for LuaPage

Source§

impl Eq for LuaPage

Source§

impl PartialEq for LuaPage

Source§

fn eq(&self, other: &LuaPage) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl RawHandle for LuaPage

Source§

type Raw = RawLuaPage

Raw VM record addressed by this handle.
Source§

fn as_ptr(&self) -> *mut Self::Raw

Returns the record address without dereferencing it.
Source§

impl StructuralPartialEq for LuaPage

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.