Skip to main content

parse_optional_i64_param

Function parse_optional_i64_param 

Source
pub fn parse_optional_i64_param(
    field: &str,
    value: Option<&str>,
) -> Result<Option<i64>, AwsServiceError>
Expand description

Parse a string as an i64 for range validation, returning a ValidationException when the value is present but not a valid integer.

Use this instead of .parse::<i64>().ok() + validate_optional_range_i64 to catch non-numeric strings that would silently fall through to defaults.