Trait ext_php_rs::convert::FromZendObject
source · 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>
Extracts Self
from the source ZendObject
.
Object Safety§
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.