Function match_string

Source
pub fn match_string(data: &[u8]) -> (bool, usize)
Expand description

Attempt to match a string against a byte slice. Stop matching when a punctuation character is encountered.

  • U+0021 ..= U+002F ! “ # $ % & ’ ( ) * + , - . /, or
  • U+003A ..= U+0040 : ; < = > ? @, or
  • U+005B ..= U+0060 [ \ ] ^ _ `, or
  • U+007B ..= U+007E { | } ~

§Arguments

  • data - The byte slice to match against.

§Returns

A tuple containing a boolean indicating whether the match succeeded and the number of bytes consumed if the match succeeded.