Skip to main content

parse_cpu

Function parse_cpu 

Source
pub fn parse_cpu(s: &str) -> AppResult<i64>
Expand description

Parse a human-readable CPU string into nanocores.

Supported formats (case-insensitive): cores ("0.5", "1") and millicores ("500m").

ยงErrors

Returns rskit_errors::ErrorCode::InvalidFormat when the string is empty, not a valid number, negative, or at or above the i64::MAX nanocore boundary (values that would saturate a float-to-int cast).