pub trait FromZendObject<'a>: Sized {
    // Required method
    fn from_zend_object(obj: &'a ZendObject) -> Result<Self>;
}
Expand description

FromZendObject is implemented by types which can be extracted from a Zend object.

Normal usage is through the helper method ZendObject::extract:

let obj: ZendObject = ...;
let repr: String = obj.extract();
let props: HashMap = obj.extract();

Should be functionally equivalent to casting an object to another compatible type.

Required Methods§

source

fn from_zend_object(obj: &'a ZendObject) -> Result<Self>

Extracts Self from the source ZendObject.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromZendObject<'_> for String

Implementors§

source§

impl<'a> FromZendObject<'a> for &'a Closure

Available on crate feature closure only.
source§

impl<'a, T: RegisteredClass> FromZendObject<'a> for &'a ZendClassObject<T>