pub enum Iterable<'a> {
    Array(&'a ZendHashTable),
    Traversable(&'a mut ZendIterator),
}
Expand description

This type represents a PHP iterable, which can be either an array or an object implementing the Traversable interface.

Variants§

§

Array(&'a ZendHashTable)

§

Traversable(&'a mut ZendIterator)

Implementations§

source§

impl<'a> Iterable<'a>

source

pub fn iter(&mut self) -> Option<Iter<'_>>

Creates a new rust iterator from a PHP iterable. May return None if a Traversable cannot be rewound.

Trait Implementations§

source§

impl<'a> Debug for Iterable<'a>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a> FromZval<'a> for Iterable<'a>

source§

const TYPE: DataType = DataType::Iterable

The corresponding type of the implemented value in PHP.
source§

fn from_zval(zval: &'a Zval) -> Option<Self>

Attempts to retrieve an instance of Self from a reference to a Zval. Read more
source§

impl<'a> IntoIterator for &'a mut Iterable<'a>

§

type Item = (_zval_struct, &'a _zval_struct)

The type of the elements being iterated over.
§

type IntoIter = Iter<'a>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more

Auto Trait Implementations§

§

impl<'a> RefUnwindSafe for Iterable<'a>

§

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

§

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

§

impl<'a> Unpin for Iterable<'a>

§

impl<'a> !UnwindSafe for Iterable<'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<'a, T> FromZvalMut<'a> for T
where T: FromZval<'a>,

source§

const TYPE: DataType = const TYPE: DataType = <T as FromZval>::TYPE;

The corresponding type of the implemented value in PHP.
source§

fn from_zval_mut(zval: &'a mut _zval_struct) -> Option<T>

Attempts to retrieve an instance of Self from a mutable reference to a Zval. Read more
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>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

§

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.