pub trait FromZval<'a>: Sized {
const TYPE: DataType;
const NULLABLE: bool = false;
// Required method
fn from_zval(zval: &'a Zval) -> Option<Self>;
// Provided method
fn from_missing() -> Option<Self> { ... }
}Expand description
Allows zvals to be converted into Rust types in a fallible way. Reciprocal
of the IntoZval trait.
Required Associated Constants§
Provided Associated Constants§
Required Methods§
Provided Methods§
Sourcefn from_missing() -> Option<Self>
fn from_missing() -> Option<Self>
The value to use when a PHP argument of this type was omitted by the
caller. None means the argument is required.
It must return Some exactly when NULLABLE is true. The macros
decide from NULLABLE alone which parameters PHP callers may omit.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<'a, K, V, H> FromZval<'a> for IndexMap<K, V, H>
Available on crate feature indexmap only.
impl<'a, K, V, H> FromZval<'a> for IndexMap<K, V, H>
Available on crate feature
indexmap only.Source§impl<'a, V, H> FromZval<'a> for IndexMap<ArrayKey<'a>, V, H>
Available on crate feature indexmap only.
impl<'a, V, H> FromZval<'a> for IndexMap<ArrayKey<'a>, V, H>
Available on crate feature
indexmap only.Source§impl<M: SmartStringMode> FromZval<'_> for SmartString<M>
Available on crate feature smartstring only.
impl<M: SmartStringMode> FromZval<'_> for SmartString<M>
Available on crate feature
smartstring only.Implementors§
Source§impl<'a, T: RegisteredClass> FromZval<'a> for &'a ZendClassObject<T>
impl<'a, T: RegisteredClass> FromZval<'a> for &'a ZendClassObject<T>
Source§impl<'a, T> FromZval<'a> for BinarySlice<'a, T>where
T: PackSlice,
impl<'a, T> FromZval<'a> for BinarySlice<'a, T>where
T: PackSlice,
Source§impl<T> FromZval<'_> for Twhere
T: RegisteredEnum + RegisteredClass,
Available on crate feature enum only.
impl<T> FromZval<'_> for Twhere
T: RegisteredEnum + RegisteredClass,
Available on crate feature
enum only.