pub struct ClassMetadata<T> { /* private fields */ }
Expand description

Stores the class entry and handlers for a Rust type which has been exported to PHP. Usually allocated statically.

Implementations§

source§

impl<T> ClassMetadata<T>

source

pub const fn new() -> Self

Creates a new class metadata instance.

source§

impl<T: RegisteredClass> ClassMetadata<T>

source

pub fn handlers(&self) -> &ZendObjectHandlers

Returns an immutable reference to the object handlers contained inside the class metadata.

source

pub fn has_ce(&self) -> bool

Checks if the class entry has been stored, returning a boolean.

source

pub fn ce(&self) -> &'static ClassEntry

Retrieves a reference to the stored class entry.

§Panics

Panics if there is no class entry stored inside the class metadata.

source

pub fn set_ce(&self, ce: &'static mut ClassEntry)

Stores a reference to a class entry inside the class metadata.

§Parameters
  • ce - The class entry to store.
§Panics

Panics if the class entry has already been set in the class metadata. This function should only be called once.

source

pub fn get_properties(&self) -> &HashMap<&'static str, Property<'static, T>>

Retrieves a reference to the hashmap storing the classes property accessors.

§Returns

Immutable reference to the properties hashmap.

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for ClassMetadata<T>

§

impl<T> Send for ClassMetadata<T>

§

impl<T> Sync for ClassMetadata<T>

§

impl<T> Unpin for ClassMetadata<T>

§

impl<T> !UnwindSafe for ClassMetadata<T>

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

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

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.