(introduced_by: NodeId, value: InodeAttr)
| 23 | |
| 24 | impl InodeAttrEvent { |
| 25 | pub fn new(introduced_by: NodeId, value: InodeAttr) -> Result<Self, PristineError> { |
| 26 | value.validate().map_err(invalid_attr)?; |
| 27 | if introduced_by == NodeId::ROOT { |
| 28 | return Err(PristineError::Inconsistent { |
| 29 | message: "inode attribute event cannot be introduced by ROOT".to_string(), |
| 30 | }); |
| 31 | } |
| 32 | Ok(Self { |
| 33 | introduced_by, |
| 34 | value, |
| 35 | }) |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | /// The causally maximal values of one attribute. |