Crate byte_slice

Source

Modules§

  • Byte stream collection macros.

Macros§

  • Retrieve the amount of readable bytes.
  • Iterate $context.stream, and for each byte execute $on_byte. Upon locating end-of-stream execute $on_eos.
  • Collect all sequential digit bytes into $var (u8), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential digit bytes into $var (u16), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential digit bytes into $var (u32), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential digit bytes into $var (u64), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential hex bytes into $var (u8), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential hex bytes into $var (u16), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential hex bytes into $var (u32), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect all sequential hex bytes into $var (u64), and convert them into an unsigned integer. If $on_byte is supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos. If an overflow would occur, execute $on_overflow.
  • Collect $length bytes. If $on_byte and $on_eos are supplied, for each new byte execute $on_byte. Upon locating end-of-stream execute $on_eos.
  • Collect if $until yields false.
  • Collect if $when yields true.
  • Count each occurrence of $byte starting at $context.stream_index until end-of-stream.
  • Count each byte loop starting at $context.stream_index until end-of-stream, if $when yields true.
  • Find the first occurrence of $byte and return the index relative to $context.stream_index.
  • Find the first occurrence of $pattern and return the index relative to $context.stream_index.
  • Indicates that a specified amount of bytes are available for reading.
  • Retrieve the current stream index.
  • Indicates that we’re at the end of the stream.
  • Jump $length bytes.
  • Set $context.mark_index to the current stream index or $index.
  • Advance $context.stream_index one byte and set $context.byte to the new byte.
  • Peek at a slice of bytes.
  • Retrieve the remaining available bytes.
  • Replay the most recent byte, but do not change the current $context.byte.
  • Rewind $context.stream_index by $length bytes, but do not change the current $context.byte.
  • Rewind $context.stream_index to index $index, but do not change the current $context.byte.
  • Retrieve the slice of marked bytes.
  • Retrieve the slice of marked bytes ignoring the very last byte.
  • Retrieve the length of marked bytes.
  • Determine if the remaining stream starts with $pattern.
  • Determine if the remaining stream starts with $pattern, comparing only the first byte.
  • Determine if the remaining stream starts with $pattern, comparing only the first 2 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 3 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 4 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 5 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 6 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 7 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 8 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 9 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 10 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 11 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 12 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 13 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 14 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 15 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 16 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 17 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 18 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 19 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 20 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 21 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 22 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 23 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 24 bytes.
  • Determine if the remaining stream starts with $pattern, comparing only the first 25 bytes.
  • Indicates that a byte is alphabetical.
  • Indicates that a byte is a control character.
  • Indicates that a byte is a digit.
  • Indicates that a byte is a hex character.
  • Indicates that a byte is not a visible 7-bit character. Space is not considered visible.
  • Indicates that a byte is not a visible 8-bit character. Space is not considered visible.
  • Indicates that a byte is a visible 7-bit character. Space is not considered visible.
  • Indicates that a byte is a visible 8-bit character. Space is not considered visible.

Structs§