pub trait Iterable<T: CubeType>: Sized {
// Required methods
fn expand(
self,
context: &mut CubeContext,
body: impl FnMut(&mut CubeContext, <T as CubeType>::ExpandType),
);
fn expand_unroll(
self,
context: &mut CubeContext,
body: impl FnMut(&mut CubeContext, <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,
context: &mut CubeContext,
body: impl FnMut(&mut CubeContext, <T as CubeType>::ExpandType),
)
fn expand( self, context: &mut CubeContext, body: impl FnMut(&mut CubeContext, <T as CubeType>::ExpandType), )
Expand a runtime loop without unrolling
§Arguments
context
- the expansion contextbody
- the loop body to be executed repeatedly
Sourcefn expand_unroll(
self,
context: &mut CubeContext,
body: impl FnMut(&mut CubeContext, <T as CubeType>::ExpandType),
)
fn expand_unroll( self, context: &mut CubeContext, body: impl FnMut(&mut CubeContext, <T as CubeType>::ExpandType), )
Expand an unrolled loop. The body should be invoced n
times, where n
is the number of
iterations.
§Arguments
context
- the expansion contextbody
- 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.