Skip to main content

port

Function port 

Source
pub fn port(p: u16) -> Result<()>
Expand description

Validate a port number.

§Validation Rules

  • Port must be in the range 1-65535
  • Port 0 is not allowed (reserved)

§Examples

use geode_client::validate;

assert!(validate::port(3141).is_ok());
assert!(validate::port(443).is_ok());
assert!(validate::port(0).is_err());