[][src]Derive Macro enso_shapely_macros::Iterator

#[derive(Iterator)]

For struct Foo<T> or enum Foo<T> provides:

  • IntoIterator implementations for &'t Foo<T>, iter and into_iter methods.

The iterators will:

  • for structs: go over each field that declared type is same as the struct's last type parameter.
  • enums: delegate to current constructor's nested value's iterator.

Enums are required to use only a single element tuple-like variant. This limitation should be lifted in the future.

Any dependent type stored in struct, tuple or wrapped in enum should have dependency only in its last type parameter. All dependent types that are not tuples nor directly the yielded type, are required to provide iter method that returns a compatible iterator (possible also derived).

Caller must have the following features enabled:

#![feature(generators)]
#![feature(type_alias_impl_trait)]

When used on type that takes no type parameters, like struct Foo, does nothing but yields no errors.