MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / validate

Method validate

atomic-core/src/change/attribute.rs:87–92  ·  view source on GitHub ↗

Validate that this value has a supported canonical representation.

(self)

Source from the content-addressed store, hash-verified

85
86 /// Validate that this value has a supported canonical representation.
87 pub fn validate(self) -> Result<(), AttrValueError> {
88 match self {
89 Self::Mode(mode) if mode > 0o777 => Err(AttrValueError::InvalidMode(mode)),
90 Self::Mode(_) | Self::Kind(_) => Ok(()),
91 }
92 }
93
94 /// Encode the canonical value as `(length, bytes)`.
95 pub fn canonical_bytes(self) -> Result<(u8, [u8; 2]), AttrValueError> {

Callers 9

globalize_set_attrFunction · 0.45
newMethod · 0.45
put_inode_attr_eventMethod · 0.45
apply_set_attrFunction · 0.45
set_modeMethod · 0.45
canonical_bytesMethod · 0.45
from_canonicalMethod · 0.45
validate_v2Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected