[][src]Trait monadic::monad::Bind

pub trait Bind: IntoIterator {
    fn bind<U, F>(self, f: F) -> FlatMap<Self::IntoIter, U, F>
    where
        F: Fn(Self::Item) -> U,
        U: IntoIterator,
        Self: Sized
; }

Bind as supertrait of IntoIterator

IntoIterator brings into_iter().flat_map() where its lazy result type FlatMap implements IntoIterator. It has been wrapped as bind() in trait Bind.

There are transitive implementation relations for some structures that does not implement IntoIterator to be instances of IntoIterator:

All iterators implement IntoIterator where into_iter() returns the self iterator structure as documented

Iterator and IntoIterator trait imports are predefined

Because into_iter() passes self by value, a Sized constraint (size known at compile time) is required for Self in the use of bind().

Required methods

fn bind<U, F>(self, f: F) -> FlatMap<Self::IntoIter, U, F> where
    F: Fn(Self::Item) -> U,
    U: IntoIterator,
    Self: Sized

Loading content...

Implementors

impl<R> Bind for R where
    R: IntoIterator
[src]

Loading content...