pub struct Unfold<'a, A, St> {
pub state: St,
// some fields omitted
}An iterator which just modifies the contained state throughout iteration.
Fields
Methods
impl<'a, A, St> Unfold<'a, A, St>
fn new<'a, A, St>(initial_state: St, f: |&mut St|: 'a -> Option<A>) -> Unfold<'a, A, St>
Creates a new iterator with the specified closure as the "iterator
function" and an initial state to eventually pass to the iterator
Trait Implementations
impl<'a, A, St> Iterator<A> for Unfold<'a, A, St>
fn next<'a, A, St>(&mut self) -> Option<A>
fn zip<B, U: Iterator<B>>(self, U) -> Zip<Unfold<'a, A, St>, U>
fn map<B>(self, |A|: 'r -> B) -> Map<'r, A, B, Unfold<'a, A, St>>
fn filter<'a, A, St>(self, |&A|: 'r -> bool) -> Filter<'r, A, Unfold<'a, A, St>>
fn skip<'a, A, St>(self, uint) -> Skip<Unfold<'a, A, St>>
fn take<'a, A, St>(self, uint) -> Take<Unfold<'a, A, St>>
fn scan<St, B>(self, St, |&mut St, A|: 'r -> Option<B>) -> Scan<'r, A, B, Unfold<'a, A, St>, St>
fn flat_map<B, U: Iterator<B>>(self, |A|: 'r -> U) -> FlatMap<'r, A, Unfold<'a, A, St>, U>
fn fuse<'a, A, St>(self) -> Fuse<Unfold<'a, A, St>>
fn inspect<'a, A, St>(self, |&A|: 'r) -> Inspect<'r, A, Unfold<'a, A, St>>
fn by_ref<'a, A, St>(&'r mut self) -> ByRef<'r, Unfold<'a, A, St>>
fn advance<'a, A, St>(&mut self, |A| -> bool) -> bool
fn nth<'a, A, St>(&mut self, uint) -> Option<A>
fn last<'a, A, St>(&mut self) -> Option<A>
fn fold<B>(&mut self, B, |B, A| -> B) -> B
fn count<'a, A, St>(&mut self) -> uint
fn all<'a, A, St>(&mut self, |A| -> bool) -> bool
fn any<'a, A, St>(&mut self, |A| -> bool) -> bool
fn find<'a, A, St>(&mut self, |&A| -> bool) -> Option<A>
fn max_by<B: Ord>(&mut self, |&A| -> B) -> Option<A>
fn min_by<B: Ord>(&mut self, |&A| -> B) -> Option<A>
Keyboard shortcuts
- ?
- Show this help dialog
- S
- Focus the search field
- ⇤
- Move up in search results
- ⇥
- Move down in search results
- ⏎
- Go to active search result
Search tricks
Prefix searches with a type followed by a colon (e.g.
fn:) to restrict the search to a given type.
Accepted types are: fn, mod,
struct (or str), enum,
trait, typedef (or
tdef).