Skip to main content

is_token

Function is_token 

Source
pub fn is_token(s: &[u8]) -> bool
Expand description

Whether s is a token: non-empty, every byte tchar (RFC 9110 section 5.6.2).

ยงExamples

use parse_net::text::is_token;

assert!(is_token(b"GET") && !is_token(b"GE T") && !is_token(b""));