[][src]Function battery_ffi::battery_iterator_next

#[no_mangle]pub unsafe extern "C" fn battery_iterator_next(
    ptr: *mut Batteries
) -> *mut Battery

Gets next iteration over batteries iterator.

Caller is required to call battery_free in order to properly free memory for the returned battery instance.

Panics

This function will panic if passed pointer is NULL.

Returns

Returns pointer to next battery.

If there is no batteries left to iterate or some error happened, this function will return NULL.

Caller is required to differentiate between these two cases and should check if there was any error with battery_have_last_error.

If there is no batteries left, battery_have_last_error will return 0.