Struct ext_php_rs::args::ArgParser
source · pub struct ArgParser<'a, 'b> { /* private fields */ }
Expand description
Parses the arguments of a function.
Implementations§
source§impl<'a, 'b> ArgParser<'a, 'b>
impl<'a, 'b> ArgParser<'a, 'b>
sourcepub fn new(arg_zvals: Vec<Option<&'a mut Zval>>) -> Self
pub fn new(arg_zvals: Vec<Option<&'a mut Zval>>) -> Self
Builds a new function argument parser.
sourcepub fn not_required(self) -> Self
pub fn not_required(self) -> Self
Sets the next arguments to be added as not required.
sourcepub fn parse(self) -> Result<()>
pub fn parse(self) -> Result<()>
Uses the argument parser to parse the arguments contained in the given
ExecuteData
object. Returns successfully if the arguments were
parsed.
This function can only be safely called from within an exported PHP function.
§Parameters
execute_data
- The execution data from the function.
§Errors
Returns an Error
type if there were too many or too little arguments
passed to the function. The user has already been notified so you
should break execution after seeing an error type.
Auto Trait Implementations§
impl<'a, 'b> RefUnwindSafe for ArgParser<'a, 'b>
impl<'a, 'b> !Send for ArgParser<'a, 'b>
impl<'a, 'b> !Sync for ArgParser<'a, 'b>
impl<'a, 'b> Unpin for ArgParser<'a, 'b>
impl<'a, 'b> !UnwindSafe for ArgParser<'a, 'b>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more