Skip to main content

Args

Struct Args 

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

The arguments of a raw_function call, as PHP passed them. Each accessor reads one argument; nothing is converted unless asked for.

Implementations§

Source§

impl Args<'_>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn value(&self, i: usize) -> Result<Value, NativeError>

The ith argument converted, for Rust to read (Value::Null when it was not passed).

Source

pub fn pass(&self, i: usize) -> Value

The ith argument passed through unconverted (Value::Null when it was not passed).

Source

pub fn pass_from(&self, i: usize) -> Vec<Value>

Every argument from the ith on, passed through.

Source

pub fn items(&self, i: usize) -> Vec<Value>

The elements of the ith argument, an array, each passed through, in order (empty when it is not an array). An element that is a PHP reference (array( &$var )) stays one, so a callback given it changes the variable.

Source

pub fn string_hash(&self, i: usize) -> Option<u64>

The hash PHP keeps for the ith argument, a string; None for anything else.

Source

pub fn int(&self, i: usize) -> Option<i64>

The ith argument if it is an integer.

Source

pub fn is_false(&self, i: usize) -> bool

True when the ith argument is false.

Source

pub fn single_object(&self, i: usize) -> Option<Value>

The object of an ith argument that is [$object] (an array of one object, at key 0).

Auto Trait Implementations§

§

impl<'a> !Send for Args<'a>

§

impl<'a> !Sync for Args<'a>

§

impl<'a> Forget for Args<'a>

§

impl<'a> Freeze for Args<'a>

§

impl<'a> Move for Args<'a>

§

impl<'a> RefUnwindSafe for Args<'a>

§

impl<'a> Unpin for Args<'a>

§

impl<'a> UnsafeUnpin for Args<'a>

§

impl<'a> UnwindSafe for Args<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.