pub struct StaticModuleEntry { /* private fields */ }Expand description
Static storage for a ModuleEntry that avoids heap allocation.
Mimics how C extensions declare a static zend_module_entry. The entry
lives in the shared library’s data segment and is reclaimed automatically
when PHP calls DL_UNLOAD.
Implementations§
Source§impl StaticModuleEntry
impl StaticModuleEntry
Sourcepub fn get_or_init(&self, f: impl FnOnce() -> ModuleEntry) -> *mut ModuleEntry
pub fn get_or_init(&self, f: impl FnOnce() -> ModuleEntry) -> *mut ModuleEntry
Initialises the entry on first call, returning a stable *mut pointer.
Subsequent calls skip f and return the same pointer.
Trait Implementations§
Source§impl Default for StaticModuleEntry
impl Default for StaticModuleEntry
impl Sync for StaticModuleEntry
Auto Trait Implementations§
impl !Freeze for StaticModuleEntry
impl !RefUnwindSafe for StaticModuleEntry
impl !Send for StaticModuleEntry
impl Unpin for StaticModuleEntry
impl UnsafeUnpin for StaticModuleEntry
impl UnwindSafe for StaticModuleEntry
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