mirror of
https://github.com/danog/ext-php-rs.git
synced 2025-01-22 13:01:24 +01:00
Implement IntoZvalDyn for Zval (#256)
This commit is contained in:
parent
5d1ffcec05
commit
7b35476d04
@ -131,7 +131,8 @@ impl ModuleBuilder {
|
||||
/// This function can be useful if you need to do any final cleanup at the
|
||||
/// very end of a request, after all other resources have been released. For
|
||||
/// example, if your extension creates any persistent resources that last
|
||||
/// beyond a single request, you could use this function to clean those up. # Arguments
|
||||
/// beyond a single request, you could use this function to clean those up.
|
||||
/// # Arguments
|
||||
///
|
||||
/// * `func` - The function to be called when shutdown is requested.
|
||||
pub fn post_deactivate_function(mut self, func: extern "C" fn() -> i32) -> Self {
|
||||
|
@ -218,3 +218,13 @@ impl<T: IntoZval + Clone> IntoZvalDyn for T {
|
||||
Self::TYPE
|
||||
}
|
||||
}
|
||||
|
||||
impl IntoZvalDyn for Zval {
|
||||
fn as_zval(&self, _persistent: bool) -> Result<Zval> {
|
||||
Ok(self.shallow_clone())
|
||||
}
|
||||
|
||||
fn get_type(&self) -> DataType {
|
||||
self.get_type()
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user