pub fn permutation<'a, 'b: 'a, T, const DEGREE: usize>(
    row: &'b [T],
) -> Box<dyn Poseidon2Cols<T> + 'a>
where
    T: Copy,
{
    if DEGREE == 3 {
        let start = POSEIDON2_DEGREE3_COL_MAP.state.external_rounds_state[0][0];
        let end = start + size_of::<Poseidon2Degree3Cols<u8>>();
        let convert: Poseidon2Degree3Cols<T> = *row[start..end].borrow();
        Box::new(convert)
    } else if DEGREE == 9 || DEGREE == 17 {
        let start = POSEIDON2_DEGREE9_COL_MAP.state.external_rounds_state[0][0];
        let end = start + size_of::<Poseidon2Degree9Cols<u8>>();

        let convert: Poseidon2Degree9Cols<T> = *row[start..end].borrow();
        Box::new(convert)
    } else {
        panic!("Unsupported degree");
    }
}
Convert a row to an immutable [`Poseidon2Cols`] instance.
crates/core/machine/src/operations/poseidon2/permutation.rs