pub struct FunctionBuilder<'a> { /* private fields */ }
Expand description

Builder for registering a function in PHP.

Implementations§

Creates a new function builder, used to build functions to be exported to PHP.

Parameters
  • name - The name of the function.
  • handler - The handler to be called when the function is invoked from PHP.

Create a new function builder for an abstract function that can be used on an abstract class or an interface.

Parameters
  • name - The name of the function.

Creates a constructor builder, used to build the constructor for classes.

Parameters
  • handler - The handler to be called when the function is invoked from PHP.

Adds an argument to the function.

Parameters
  • arg - The argument to add to the function.

Sets the rest of the given arguments as not required.

Sets the return value of the function.

Parameters
  • type_ - The return type of the function.
  • as_ref - Whether the function returns a reference.
  • allow_null - Whether the function return value is nullable.

Builds the function converting it into a Zend function entry.

Returns a result containing the function entry if successful.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.