Skip to main content

deserialize_mode_text

Function deserialize_mode_text 

Source
pub fn deserialize_mode_text<'de, D: Deserializer<'de>>(
    d: D,
) -> Result<String, D::Error>
Expand description

A serde deserialize_with helper for a file mode in octal text ("0640"). A whole number is taken by its digits, as the environment gives SCHEDR_CONFIG__WORKER__LOG_MODE=0640 as 640: those digits are read as octal too, and checked as the text would be.

ยงErrors

Fails for a value that is neither a string nor a whole number.