Struct phper_alloc::EBox

source ·
pub struct EBox<T> { /* private fields */ }
Expand description

The Box which use php emalloc and efree to manage memory.

TODO Now feature allocator_api is still unstable, implement myself, use Box<T, Alloc> later.

Implementations§

Allocates heap memory using emalloc then places x into it.

Panic

Panic if size_of::<T>() equals zero.

Constructs from a raw pointer.

Safety

Make sure the pointer is created from emalloc.

Consumes and returning a wrapped raw pointer.

Will leak memory.

Trait Implementations§

The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.