Struct ext_php_rs::boxed::ZBox
source · pub struct ZBox<T: ZBoxable>(_);
Expand description
A pointer type for heap allocation using the Zend memory manager.
See the module level documentation for more.
Implementations§
source§impl<T: ZBoxable> ZBox<T>
impl<T: ZBoxable> ZBox<T>
sourcepub unsafe fn from_raw(ptr: *mut T) -> Self
pub unsafe fn from_raw(ptr: *mut T) -> Self
Creates a new box from a given pointer.
Parameters
ptr
- A non-null, well-aligned pointer to aT
.
Safety
Caller must ensure that ptr
is non-null, well-aligned and pointing to
a T
.
sourcepub fn into_raw(self) -> &'static mut T
pub fn into_raw(self) -> &'static mut T
Returns the pointer contained by the box, dropping the box in the process. The data pointed to by the returned pointer is not released.
Safety
The caller is responsible for managing the memory pointed to by the returned pointer, including freeing the memory.
Trait Implementations§
source§impl<T: RegisteredClass + Clone> Clone for ZBox<ZendClassObject<T>>
impl<T: RegisteredClass + Clone> Clone for ZBox<ZendClassObject<T>>
source§impl Clone for ZBox<ZendHashTable>
impl Clone for ZBox<ZendHashTable>
source§impl<T: RegisteredClass + Default> Default for ZBox<ZendClassObject<T>>
impl<T: RegisteredClass + Default> Default for ZBox<ZendClassObject<T>>
source§impl Default for ZBox<ZendHashTable>
impl Default for ZBox<ZendHashTable>
source§impl<T: RegisteredClass> From<ZBox<ZendClassObject<T>>> for ZBox<ZendObject>
impl<T: RegisteredClass> From<ZBox<ZendClassObject<T>>> for ZBox<ZendObject>
source§fn from(obj: ZBox<ZendClassObject<T>>) -> Self
fn from(obj: ZBox<ZendClassObject<T>>) -> Self
Converts to this type from the input type.