Type Definition ext_php_rs::zend::ClassEntry

source ·
pub type ClassEntry = zend_class_entry;
Expand description

A PHP class entry.

Represents a class registered with the PHP interpreter.

Implementations§

source§

impl ClassEntry

source

pub fn try_find(name: &str) -> Option<&'static Self>

Attempts to find a reference to a class in the global class table.

Returns a reference to the class if found, or None if the class could not be found or the class table has not been initialized.

source

pub fn flags(&self) -> ClassFlags

Returns the class flags.

source

pub fn is_interface(&self) -> bool

Returns true if the class entry is an interface, and false otherwise.

source

pub fn instance_of(&self, other: &ClassEntry) -> bool

Checks if the class is an instance of another class or interface.

Parameters
  • other - The inherited class entry to check.
source

pub fn interfaces(&self) -> Option<impl Iterator<Item = &ClassEntry>>

Returns an iterator of all the interfaces that the class implements.

Returns None if the interfaces have not been resolved on the class.

source

pub fn parent(&self) -> Option<&Self>

Returns the parent of the class.

If the parent of the class has not been resolved, it attempts to find the parent by name. Returns None if the parent was not resolved and the parent was not able to be found by name.

Trait Implementations§

source§

impl Debug for ClassEntry

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl PartialEq<_zend_class_entry> for ClassEntry

source§

fn eq(&self, other: &Self) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.