pub fn is_valid_port(s: &str) -> boolExpand description
Validates a port number string.
Checks if the string represents a valid TCP/UDP port number (1-65535). Port 0 is not considered valid.
§Arguments
s- The string to validate
§Returns
true if the string is a valid port number, false otherwise.
§Example
use stem_rs::util::is_valid_port;
assert!(is_valid_port("80"));
assert!(is_valid_port("443"));
assert!(is_valid_port("9051")); // Tor control port
assert!(is_valid_port("65535"));
assert!(!is_valid_port("0")); // Port 0 not valid
assert!(!is_valid_port("65536")); // Too large
assert!(!is_valid_port("abc")); // Non-numeric