Trait ext_php_rs::convert::IntoZval[][src]

pub trait IntoZval: Sized {
    const TYPE: DataType;

    fn set_zval(self, zv: &mut Zval, persistent: bool) -> Result<()>;

    fn into_zval(self, persistent: bool) -> Result<Zval> { ... }
}
Expand description

Provides implementations for converting Rust primitive types into PHP zvals. Alternative to the built-in Rust From and TryFrom implementations, allowing the caller to specify whether the Zval contents will persist between requests.

Associated Constants

The corresponding type of the implemented value in PHP.

Required methods

Sets the content of a pre-existing zval. Returns a result containing nothing if setting the content was successful.

Parameters
  • zv - The Zval to set the content of.
  • persistent - Whether the contents of the Zval will persist between requests.

Provided methods

Converts a Rust primitive type into a Zval. Returns a result containing the Zval if successful.

Parameters
  • persistent - Whether the contents of the Zval will persist between requests.

Implementations on Foreign Types

Implementors