#[cfg(nightly_coro)]
use core::iter::from_coroutine;
use core::iter::{empty, from_fn, once, once_with, repeat, repeat_n, repeat_with, successors, zip};
#[doc = crate::_tags!(iterator namespace)]
#[doc = crate::_doc_meta!{location("data/access/iter")}]
#[derive(Debug)]
pub struct Iter;
impl Iter {
pub const fn empty<T>() -> ::core::iter::Empty<T> {
empty()
}
#[cfg(nightly_coro)]
#[cfg_attr(nightly_doc, doc(cfg(nightly_coro)))]
pub fn from_coroutine<G>(coroutine: G) -> ::core::iter::FromCoroutine<G>
where
G: crate::Coroutine<Return = ()> + Unpin,
{
from_coroutine(coroutine)
}
pub fn from_fn<T, F>(f: F) -> ::core::iter::FromFn<F>
where
F: FnMut() -> Option<T>,
{
from_fn(f)
}
pub fn once<T>(value: T) -> ::core::iter::Once<T> {
once(value)
}
pub fn once_with<A, F>(make: F) -> ::core::iter::OnceWith<F>
where
F: FnOnce() -> A,
{
once_with(make)
}
pub fn repeat<T>(elt: T) -> ::core::iter::Repeat<T>
where
T: Clone,
{
repeat(elt)
}
pub fn repeat_n<T>(element: T, count: usize) -> ::core::iter::RepeatN<T>
where
T: Clone,
{
repeat_n(element, count)
}
pub fn repeat_with<A, F>(repeater: F) -> ::core::iter::RepeatWith<F>
where
F: FnMut() -> A,
{
repeat_with(repeater)
}
pub fn successors<T, F>(first: Option<T>, succ: F) -> ::core::iter::Successors<T, F>
where
F: FnMut(&T) -> Option<T>,
{
successors(first, succ)
}
pub fn zip<A, B>(
a: A,
b: B,
) -> ::core::iter::Zip<<A as IntoIterator>::IntoIter, <B as IntoIterator>::IntoIter>
where
A: IntoIterator,
B: IntoIterator,
{
zip(a, b)
}
}