Skip to main content

ModuleAllocations

Struct ModuleAllocations 

Source
pub struct ModuleAllocations {
    pub functions: Box<[FunctionEntry]>,
    pub arg_info: Box<[Box<[ArgInfo]>]>,
    pub name: CString,
    pub version: CString,
}
Expand description

The heap allocations a ModuleEntry points into.

A C extension puts its zend_function_entry[], name and version in .rodata, so the linker owns them for the life of the process. ext-php-rs builds them at MINIT from an arbitrary #[php_module] body, so this struct owns them instead, stored inside the extension’s own StaticModuleEntry.

None of it can be freed. module_destructor walks module->functions reading fname after MSHUTDOWN for dl()-loaded modules, get_extension_funcs() walks it during a request, and zend_register_functions keeps zend_internal_function.arg_info pointing into arg_info for the whole process.

Fields§

§functions: Box<[FunctionEntry]>

The module’s function table, NUL-terminated.

§arg_info: Box<[Box<[ArgInfo]>]>

Argument info of each module function, one table per function.

§name: CString

The module name handed to PHP.

§version: CString

The module version handed to PHP.

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.