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§
Sourcefn from_zend_object(obj: &'a ZendObject) -> Result<Self>
fn from_zend_object(obj: &'a ZendObject) -> Result<Self>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl FromZendObject<'_> for String
impl FromZendObject<'_> for String
fn from_zend_object(obj: &ZendObject) -> Result<Self>
Implementors§
impl<'a> FromZendObject<'a> for &'a Closure
Available on crate feature
closure
only.