Function rustream::squire::startup::parse_max_payload
source · fn parse_max_payload(key: &str) -> Option<usize>Expand description
Parses the maximum payload size from human-readable memory format to bytes.
key- Key for the environment variable.
§See Also
- This function handles internal panic gracefully, in the most detailed way possible.
- Panic outputs are suppressed with a custom hook.
- Custom hook is set before wrapping the potentially panicking function inside
catch_unwind. - Custom hook is reset later, so the future panics and go uncaught.
- Error message from panic payload is also further processed, to get a detailed reason for panic.
§Returns
Returns an option of usize if the value is parsable and within the allowed size limit.