Function conch_runtime::spawn::case [] [src]

pub fn case<IA, IW, IS, E: ?Sized>(
    word: IW::Item,
    arms: IA
) -> Case<IA::IntoIter, IW, IS, E> where
    IA: IntoIterator<Item = PatternBodyPair<IW, IS>>,
    IW: IntoIterator,
    IW::Item: WordEval<E>,
    IS: IntoIterator,
    IS::Item: Spawn<E>, 

Spawns a Case commands from a word to match number of case arms.

First the provided word will be evaluated and compared to each pattern of each case arm. The first arm which contains a pattern that matches the word will have its (and only its) body evaluated.

If no arms are matched, the case command will exit successfully.