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§
Sourcefn expand(
self,
scope: &mut Scope,
body: impl FnMut(&mut Scope, <T as CubeType>::ExpandType),
)
fn expand( self, scope: &mut Scope, body: impl FnMut(&mut Scope, <T as CubeType>::ExpandType), )
Sourcefn expand_unroll(
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 an unrolled loop. The body should be invoced n
times, where n
is the number of
iterations.
§Arguments
scope
- the expansion scopebody
- 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.