Trait Iterable

Source
pub trait Iterable<T: CubeType>: Sized {
    // Required methods
    fn expand(
        self,
        scope: &mut Scope,
        body: impl FnMut(&mut Scope, <T as CubeType>::ExpandType),
    );
    fn expand_unroll(
        self,
        scope: &mut Scope,
        body: impl FnMut(&mut Scope, <T as CubeType>::ExpandType),
    );
}
Expand description

Something that can be iterated on by a for loop. Currently only includes Range, StepBy and Sequence.

Required Methods§

Source

fn expand( self, scope: &mut Scope, body: impl FnMut(&mut Scope, <T as CubeType>::ExpandType), )

Expand a runtime loop without unrolling

§Arguments
§Arguments
  • scope - the expansion scope
  • body - the loop body to be executed repeatedly
Source

fn expand_unroll( self, scope: &mut Scope, body: impl FnMut(&mut Scope, <T as CubeType>::ExpandType), )

Expand an unrolled loop. The body should be invoced n times, where n is the number of iterations.

§Arguments
  • scope - the expansion scope
  • body - the loop body to be executed repeatedly

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§