1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#[derive(Debug, Clone, Default)]
pub enum Projection {
    #[default]
    All,
    Partial(Vec<usize>),
}

impl Projection {
    pub fn new(indices: impl AsRef<[usize]>) -> Self {
        Self::Partial(Vec::from(indices.as_ref()))
    }
}

impl From<Vec<usize>> for Projection {
    fn from(indices: Vec<usize>) -> Self {
        Self::Partial(indices)
    }
}