pub enum Arg<'a> {
Null,
Bool(bool),
Int(i64),
Float(f64),
Str(&'a [u8]),
Array(usize),
Object,
}Expand description
A PHP value as the formatting and conversion functions see it.
Variants§
Null
PHP null.
Bool(bool)
A PHP bool.
Int(i64)
A PHP int.
Float(f64)
A PHP float.
Str(&'a [u8])
A (byte) string.
Array(usize)
An array with this many elements.
Object
A stdClass object.
Implementations§
Source§impl Arg<'_>
impl Arg<'_>
Sourcepub fn to_int(&self) -> i64
pub fn to_int(&self) -> i64
zval_get_long, the (int) cast: floats truncate (out of range:
modulo 2^64, non-finite: 0), strings use their leading number
(str_to_int), arrays are 0 or 1, a stdClass is 1.
Sourcepub fn to_float(&self) -> f64
pub fn to_float(&self) -> f64
zval_get_double, the (float) cast: strings use their leading
number (str_to_float), arrays are 0.0 or 1.0, a stdClass is 1.0.
Trait Implementations§
impl<'a> Copy for Arg<'a>
impl<'a> StructuralPartialEq for Arg<'a>
Auto Trait Implementations§
impl<'a> Forget for Arg<'a>
impl<'a> Freeze for Arg<'a>
impl<'a> Move for Arg<'a>
impl<'a> RefUnwindSafe for Arg<'a>
impl<'a> Send for Arg<'a>
impl<'a> Sync for Arg<'a>
impl<'a> Unpin for Arg<'a>
impl<'a> UnsafeUnpin for Arg<'a>
impl<'a> UnwindSafe for Arg<'a>
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