That’s just a very bad API. You could do the same in Rust? There are nice C APIs that would use a nice struct that describes the timeout you want… eg GCD.
What Rust calls an enum, but an enum with payloads. In C terms it would be a discriminated union.