Skip to main content

set_mode_from_env

Function set_mode_from_env 

Source
pub fn set_mode_from_env() -> Option<Mode>
Expand description

Set the mode from YO_ALLOC, which is off, report or abort.

Answers None when the variable is set to something else, and the caller is expected to refuse to start rather than carry on. A typo that silently turns the check off is precisely the failure this module exists to prevent, so it is not treated as an unset variable.

An unset variable is Mode::Off and is not an error.