pub enum ArrayKey<'a> {
Long(i64),
String(String),
Str(&'a str),
ZendString(&'a ZendStr),
}Expand description
Represents the key of a PHP array, which can be either a long or a string.
Variants§
Long(i64)
A numerical key.
In Zend API it’s represented by u64 (zend_ulong), so the value needs
to be cast to zend_ulong before passing into Zend functions.
String(String)
A string key.
Str(&'a str)
A string key by reference.
ZendString(&'a ZendStr)
A PHP zend_string key.
Allows bypassing repeated zend_string_init allocations and re-hashing
when working with pre-existing or interned PHP strings
Implementations§
Trait Implementations§
impl<'a> Eq for ArrayKey<'a>
Source§impl<'a> From<&'a _zend_string> for ArrayKey<'a>
impl<'a> From<&'a _zend_string> for ArrayKey<'a>
Source§impl<'a> FromZval<'a> for ArrayKey<'_>
impl<'a> FromZval<'a> for ArrayKey<'_>
Source§const TYPE: DataType = DataType::String
const TYPE: DataType = DataType::String
The corresponding type of the implemented value in PHP.
Source§const NULLABLE: bool = false
const NULLABLE: bool = false
Whether a PHP argument of this type accepts
null and may be omitted. Read moreSource§fn from_missing() -> Option<Self>
fn from_missing() -> Option<Self>
The value to use when a PHP argument of this type was omitted by the
caller.
None means the argument is required. Read moreSource§impl<'a> Ord for ArrayKey<'a>
impl<'a> Ord for ArrayKey<'a>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<'a> PartialOrd for ArrayKey<'a>
impl<'a> PartialOrd for ArrayKey<'a>
impl<'a> StructuralPartialEq for ArrayKey<'a>
Auto Trait Implementations§
impl<'a> Freeze for ArrayKey<'a>
impl<'a> RefUnwindSafe for ArrayKey<'a>
impl<'a> Send for ArrayKey<'a>
impl<'a> Sync for ArrayKey<'a>
impl<'a> Unpin for ArrayKey<'a>
impl<'a> UnsafeUnpin for ArrayKey<'a>
impl<'a> UnwindSafe for ArrayKey<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<'a, T> FromZvalMut<'a> for Twhere
T: FromZval<'a>,
impl<'a, T> FromZvalMut<'a> for Twhere
T: FromZval<'a>,
Source§const TYPE: DataType = const TYPE: DataType = <T as FromZval>::TYPE;
const TYPE: DataType = const TYPE: DataType = <T as FromZval>::TYPE;
The corresponding type of the implemented value in PHP.
Source§const NULLABLE: bool = const NULLABLE: bool = <T as FromZval>::NULLABLE;
const NULLABLE: bool = const NULLABLE: bool = <T as FromZval>::NULLABLE;
Whether a PHP argument of this type accepts
null and may be omitted.Source§fn from_zval_mut(zval: &'a mut _zval_struct) -> Option<T>
fn from_zval_mut(zval: &'a mut _zval_struct) -> Option<T>
Source§fn from_missing() -> Option<T>
fn from_missing() -> Option<T>
The value to use when a PHP argument of this type was omitted by the
caller.
None means the argument is required. Read more