Struct ext_php_rs::ffi::_zend_object_iterator
source · #[repr(C)]pub struct _zend_object_iterator {
pub std: zend_object,
pub data: zval,
pub funcs: *const zend_object_iterator_funcs,
pub index: zend_ulong,
}
Fields§
§std: zend_object
§data: zval
§funcs: *const zend_object_iterator_funcs
§index: zend_ulong
Implementations§
source§impl _zend_object_iterator
impl _zend_object_iterator
sourcepub fn iter(&mut self) -> Option<Iter<'_>>
pub fn iter(&mut self) -> Option<Iter<'_>>
Creates a new rust iterator from a zend_object_iterator.
Returns a iterator over the zend_object_iterator, or None if the iterator cannot be rewound.
sourcepub fn valid(&mut self) -> bool
pub fn valid(&mut self) -> bool
Check if the current position of the iterator is valid.
As an example this will call the user defined valid method of the [‘\Iterator’] interface. see https://www.php.net/manual/en/iterator.valid.php
sourcepub fn rewind(&mut self) -> bool
pub fn rewind(&mut self) -> bool
Rewind the iterator to the first element.
As an example this will call the user defined rewind method of the [‘\Iterator’] interface. see https://www.php.net/manual/en/iterator.rewind.php
§Returns
Returns true if the iterator was successfully rewind, false otherwise. (when there is an exception during rewind)
sourcepub fn move_forward(&mut self) -> bool
pub fn move_forward(&mut self) -> bool
Move the iterator forward to the next element.
As an example this will call the user defined next method of the [‘\Iterator’] interface. see https://www.php.net/manual/en/iterator.next.php
§Returns
Returns true if the iterator was successfully move, false otherwise. (when there is an exception during next)
sourcepub fn get_current_data<'a>(&mut self) -> Option<&'a Zval>
pub fn get_current_data<'a>(&mut self) -> Option<&'a Zval>
Get the current data of the iterator.
§Returns
Returns a reference to the current data of the iterator if available , [‘None’] otherwise.
sourcepub fn get_current_key(&mut self) -> Option<Zval>
pub fn get_current_key(&mut self) -> Option<Zval>
Get the current key of the iterator.
§Returns
Returns a new [‘Zval’] containing the current key of the iterator if available , [‘None’] otherwise.