diskplan_schema/
attributes.rs

1use std::fmt::Debug;
2
3use super::Expression;
4
5/// Owner, group and UNIX permissions
6#[derive(Debug, Default, Clone, PartialEq, Eq)]
7pub struct Attributes<'t> {
8    /// The owner to be set, if given
9    pub owner: Option<Expression<'t>>,
10    /// The group to be set, if given
11    pub group: Option<Expression<'t>>,
12    /// The UNIX permissions to be set, if given
13    pub mode: Option<u16>,
14}
15
16impl<'t> Attributes<'t> {
17    /// Returns true if no attributes are to be set by this entry
18    pub fn is_empty(&self) -> bool {
19        matches!(
20            self,
21            Attributes {
22                owner: None,
23                group: None,
24                mode: None,
25            }
26        )
27    }
28}