MCPcopy Create free account
hub / github.com/archlinux/alpm / mode

Function mode

alpm-mtree/src/parser.rs:193–200  ·  view source on GitHub ↗

Parse a filesystem mode. Should be between 3-5 octal numbers **without** a `0o` prefix.

(input: &mut &'s str)

Source from the content-addressed store, hash-verified

191///
192/// Should be between 3-5 octal numbers **without** a `0o` prefix.
193fn mode<'s>(input: &mut &'s str) -> ModalResult<&'s str> {
194 cut_err(take_while(3..5, AsChar::is_oct_digit))
195 .context(StrContext::Label("file mode"))
196 .context(StrContext::Expected(StrContextValue::Description(
197 "octal string of length 3-5.",
198 )))
199 .parse_next(input)
200}
201
202/// Parse a SHA-256 hash.
203fn sha256(input: &mut &str) -> ModalResult<Sha256Checksum> {

Callers 2

set_propertyFunction · 0.85
propertyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected