Struct ext_php_rs::types::ZendClassObject [−][src]
#[repr(C)]pub struct ZendClassObject<T> {
pub obj: Option<T>,
pub std: ZendObject,
}
Expand description
Representation of a Zend class object in memory.
Fields
obj: Option<T>
std: ZendObject
Implementations
Creates a new ZendClassObject
of type T
, where T
is a
RegisteredClass
in PHP, storing the given value val
inside the
object.
Parameters
val
- The value to store inside the object.
Panics
Panics if memory was unable to be allocated for the new object.
Creates a new ZendClassObject
of type T
, with an uninitialized
internal object.
Safety
As the object is uninitialized, the caller must ensure the following until the internal object is initialized:
- The object is never dereferenced to
T
. - The
Clone
implementation is never called. - The
Debug
implementation is never called.
If any of these conditions are not met while not initialized, the
corresponding function will panic. Converting the object into its
inner pointer with the into_raw
function is valid, however.
Panics
Panics if memory was unable to be allocated for the new object.
Initializes the class object with the value val
.
Parameters
val
- The value to initialize the object with.
Returns
Returns the old value in an Option
if the object had already been
initialized, None
otherwise.
Returns a mutable reference to the ZendClassObject
of a given zend
object obj
. Returns None
if the given object is not of the
type T
.
Parameters
obj
- The zend object to get theZendClassObject
for.
Returns a mutable reference to the ZendClassObject
of a given zend
object obj
. Returns None
if the given object is not of the
type T
.
Parameters
obj
- The zend object to get theZendClassObject
for.
Returns a mutable reference to the underlying Zend object.
Trait Implementations
Extracts Self
from the source ZendObject
.
Extracts Self
from the source ZendObject
.
Sets the content of a pre-existing zval. Returns a result containing nothing if setting the content was successful. Read more