Struct ext_php_rs::php::types::callable::Callable [−][src]
pub struct Callable<'a>(_);
Expand description
Implementations
Attempts to create a new Callable
from a zval.
Parameters
callable
- The underlyingZval
that is callable.
Errors
Returns an error if the Zval
was not callable.
Attempts to create a new Callable
by taking ownership of a Zval. Returns a result
containing the callable if the zval was callable.
Parameters
callable
- TThe underlyingZval
that is callable.
Attempts to create a new Callable
from a function name. Returns a result containing the
callable if the function existed and was callable.
Parameters
name
- Name of the callable function.
Attempts to call the callable with a list of arguments to pass to the function. Note that a thrown exception inside the callable is not detectable, therefore you should check if the return value is valid rather than unwrapping. Returns a result containing the return value of the function, or an error.
You should not call this function directly, rather through the call_user_func
macro.
Parameters
params
- A list of parameters to call the function with.