Skip to main content

chain_walk

Function chain_walk 

Source
pub fn chain_walk(
    chain: &[ChainHandler],
    _task: &str,
    handler_results: &HashMap<FighterId, bool>,
) -> Option<(FighterId, usize)>
Expand description

Walk the chain: each handler decides if it can handle, else passes along.

Returns (handler_id, position_in_chain) of the handler that accepted, or None if nobody can handle it.