Module ext_php_rs::props

source ·
Expand description

Types and traits for adding properties to PHP classes registered from Rust.

There are two types of properties:

  • Field properties, referencing a property on a struct.
  • Method properties, a getter and/or setter function called to get/set the value of the property.

Field types which can be used as a property implement Prop. This is automatically implemented on any type which implements Clone, IntoZval and FromZval.

Method property types only have to implement IntoZval for setters and FromZval for getters.

Properties are stored in the Property type, which allows us to store field and method properties in one data structure. Properties are usually retrieved via the RegisteredClass trait.

Enums§

  • Represents a property added to a PHP class.

Traits§

  • Implemented on types which can be used as PHP properties.

Type Aliases§