pub struct ClassProperty {
pub name: String,
pub flags: PropertyFlags,
pub default: Option<Box<dyn FnOnce() -> Result<Zval>>>,
pub docs: DocComments,
pub ty: Option<DataType>,
pub nullable: bool,
pub readonly: bool,
pub default_stub: Option<String>,
}Expand description
Metadata for a class property to be registered with PHP.
Fields§
§name: StringName of the property.
flags: PropertyFlagsVisibility and modifier flags.
default: Option<Box<dyn FnOnce() -> Result<Zval>>>Optional default value closure.
docs: DocCommentsDocumentation comments.
ty: Option<DataType>PHP type for stub generation.
nullable: boolWhether the property accepts null.
readonly: boolWhether the property is read-only (getter without setter).
default_stub: Option<String>PHP stub representation of the default value (e.g. "null", "42").
Trait Implementations§
Source§impl From<ClassProperty> for Property
impl From<ClassProperty> for Property
Source§fn from(val: ClassProperty) -> Self
fn from(val: ClassProperty) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for ClassProperty
impl !RefUnwindSafe for ClassProperty
impl !Send for ClassProperty
impl !Sync for ClassProperty
impl Unpin for ClassProperty
impl UnsafeUnpin for ClassProperty
impl !UnwindSafe for ClassProperty
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more