Skip to main content

switch

Function switch 

Source
pub fn switch<B: Backend, S: Tree<B>, R: Tree<B>>(
    index: I32<B>,
    branches: &[&dyn Fn(S) -> R],
    operand: S,
) -> R
Expand description

Calls branches[index] on operand, with the index clamped to the branches (lax.switch).

ยงPanics

Panics if there are no branches.