Trait ext_php_rs::props::Prop

source ·
pub trait Prop<'a> {
    // Required methods
    fn get(&self, zv: &mut Zval) -> Result<()>;
    fn set(&mut self, zv: &'a Zval) -> Result<()>;
}
Expand description

Implemented on types which can be used as PHP properties.

Generally, this should not be directly implemented on types, as it is automatically implemented on types that implement Clone, IntoZval and FromZval, which will be required to implement this trait regardless.

Required Methods§

source

fn get(&self, zv: &mut Zval) -> Result<()>

Gets the value of self by setting the value of zv.

Parameters
  • zv - The zval to set the value of.
source

fn set(&mut self, zv: &'a Zval) -> Result<()>

Sets the value of self with the contents of a given zval zv.

Parameters
  • zv - The zval containing the new value of self.

Implementors§

source§

impl<'a, T: Clone + IntoZval + FromZval<'a>> Prop<'a> for T