pub trait FromZval<'a>: Sized {
    const TYPE: DataType;

    // Required method
    fn from_zval(zval: &'a Zval) -> Option<Self>;
}
Expand description

Allows zvals to be converted into Rust types in a fallible way. Reciprocal of the IntoZval trait.

Required Associated Constants§

source

const TYPE: DataType

The corresponding type of the implemented value in PHP.

Required Methods§

source

fn from_zval(zval: &'a Zval) -> Option<Self>

Attempts to retrieve an instance of Self from a reference to a Zval.

§Parameters
  • zval - Zval to get value from.

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl FromZval<'_> for bool

source§

const TYPE: DataType = crate::flags::DataType::Bool

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for f32

source§

const TYPE: DataType = DataType::Double

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for f64

source§

const TYPE: DataType = crate::flags::DataType::Double

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for i8

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for i16

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for i32

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for i64

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for isize

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for u8

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for u16

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for u32

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for u64

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for usize

source§

const TYPE: DataType = crate::flags::DataType::Long

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl FromZval<'_> for String

source§

const TYPE: DataType = crate::flags::DataType::String

source§

fn from_zval(zval: &Zval) -> Option<Self>

source§

impl<'a> FromZval<'a> for &'a str

source§

const TYPE: DataType = DataType::String

source§

fn from_zval(zval: &'a Zval) -> Option<Self>

source§

impl<'a, T> FromZval<'a> for Option<T>
where T: FromZval<'a>,

source§

const TYPE: DataType = T::TYPE

source§

fn from_zval(zval: &'a Zval) -> Option<Self>

source§

impl<'a, T> FromZval<'a> for Vec<T>
where T: FromZval<'a>,

source§

const TYPE: DataType = DataType::Array

source§

fn from_zval(zval: &'a Zval) -> Option<Self>

source§

impl<'a, T> FromZval<'a> for HashMap<String, T>
where T: FromZval<'a>,

source§

const TYPE: DataType = DataType::Array

source§

fn from_zval(zval: &'a Zval) -> Option<Self>

Implementors§

source§

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

Available on crate feature closure only.
source§

impl<'a> FromZval<'a> for &'a ZendHashTable

source§

const TYPE: DataType = DataType::Array

source§

impl<'a> FromZval<'a> for &'a ZendObject

source§

impl<'a> FromZval<'a> for &'a Zval

source§

const TYPE: DataType = DataType::Mixed

source§

impl<'a> FromZval<'a> for ArrayKey

source§

const TYPE: DataType = DataType::String

source§

impl<'a> FromZval<'a> for Iterable<'a>

source§

const TYPE: DataType = DataType::Iterable

source§

impl<'a> FromZval<'a> for ZendCallable<'a>

source§

const TYPE: DataType = DataType::Callable

source§

impl<'a, T> FromZval<'a> for BinarySlice<'a, T>
where T: PackSlice,

source§

const TYPE: DataType = DataType::String

source§

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

source§

impl<T: Pack> FromZval<'_> for Binary<T>

source§

const TYPE: DataType = DataType::String