Skip to main content

try_matrix_dispatch

Function try_matrix_dispatch 

Source
pub fn try_matrix_dispatch(cmd_name: &str, tokens: &[Token]) -> Option<Verdict>
Expand description

Dispatch tokens against cmd_name’s [[command.matrix]] blocks. Looks at tokens[1] (parent) and tokens[2] (action), finds the first matrix whose parents contains the parent and whose actions map contains the action, then validates tokens[2..] against the named policy (and a guard flag if the matrix entry declared one). Returns None if no matrix matched — the handler can then fall through to its remaining special cases or deny.