byte-slice 0.1.11

Byte slice manipulation macros

Crate byte_slice [] [src]

Modules

macros

Byte stream collection macros.

Macros

bs_available

Retrieve the amount of readable bytes.

bs_collect

Iterate $context.stream, and for each byte execute $on_byte. Upon locating end-of-stream execute $on_eos.

bs_collect_digits16

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.

bs_collect_digits32

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.

bs_collect_digits64

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.

bs_collect_digits8

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.

bs_collect_hex16

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.

bs_collect_hex32

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.

bs_collect_hex64

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.

bs_collect_hex8

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.

bs_collect_length

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.

bs_collect_until

Collect if $until yields false.

bs_collect_when

Collect if $when yields true.

bs_count

Count each occurrence of $byte starting at $context.stream_index until end-of-stream.

bs_count_when

Count each byte loop starting at $context.stream_index until end-of-stream, if $when yields true.

bs_find

Find the first occurrence of $byte and return the index relative to $context.stream_index.

bs_find_pattern

Find the first occurrence of $pattern and return the index relative to $context.stream_index.

bs_has_bytes

Indicates that a specified amount of bytes are available for reading.

bs_index

Retrieve the current stream index.

bs_is_eos

Indicates that we're at the end of the stream.

bs_jump

Jump $length bytes.

bs_mark

Set $context.mark_index to the current stream index or $index.

bs_next

Advance $context.stream_index one byte and set $context.byte to the new byte.

bs_peek

Peek at a slice of bytes.

bs_remaining

Retrieve the remaining available bytes.

bs_replay

Replay the most recent byte, but do not change the current $context.byte.

bs_rewind

Rewind $context.stream_index by $length bytes, but do not change the current $context.byte.

bs_rewind_to

Rewind $context.stream_index to index $index, but do not change the current $context.byte.

bs_slice

Retrieve the slice of marked bytes.

bs_slice_ignore

Retrieve the slice of marked bytes ignoring the very last byte.

bs_slice_length

Retrieve the length of marked bytes.

bs_starts_with

Determine if the remaining stream starts with $pattern.

bs_starts_with1

Determine if the remaining stream starts with $pattern, comparing only the first byte.

bs_starts_with10

Determine if the remaining stream starts with $pattern, comparing only the first 10 bytes.

bs_starts_with11

Determine if the remaining stream starts with $pattern, comparing only the first 11 bytes.

bs_starts_with12

Determine if the remaining stream starts with $pattern, comparing only the first 12 bytes.

bs_starts_with13

Determine if the remaining stream starts with $pattern, comparing only the first 13 bytes.

bs_starts_with14

Determine if the remaining stream starts with $pattern, comparing only the first 14 bytes.

bs_starts_with15

Determine if the remaining stream starts with $pattern, comparing only the first 15 bytes.

bs_starts_with16

Determine if the remaining stream starts with $pattern, comparing only the first 16 bytes.

bs_starts_with17

Determine if the remaining stream starts with $pattern, comparing only the first 17 bytes.

bs_starts_with18

Determine if the remaining stream starts with $pattern, comparing only the first 18 bytes.

bs_starts_with19

Determine if the remaining stream starts with $pattern, comparing only the first 19 bytes.

bs_starts_with2

Determine if the remaining stream starts with $pattern, comparing only the first 2 bytes.

bs_starts_with20

Determine if the remaining stream starts with $pattern, comparing only the first 20 bytes.

bs_starts_with21

Determine if the remaining stream starts with $pattern, comparing only the first 21 bytes.

bs_starts_with22

Determine if the remaining stream starts with $pattern, comparing only the first 22 bytes.

bs_starts_with23

Determine if the remaining stream starts with $pattern, comparing only the first 23 bytes.

bs_starts_with24

Determine if the remaining stream starts with $pattern, comparing only the first 24 bytes.

bs_starts_with25

Determine if the remaining stream starts with $pattern, comparing only the first 25 bytes.

bs_starts_with3

Determine if the remaining stream starts with $pattern, comparing only the first 3 bytes.

bs_starts_with4

Determine if the remaining stream starts with $pattern, comparing only the first 4 bytes.

bs_starts_with5

Determine if the remaining stream starts with $pattern, comparing only the first 5 bytes.

bs_starts_with6

Determine if the remaining stream starts with $pattern, comparing only the first 6 bytes.

bs_starts_with7

Determine if the remaining stream starts with $pattern, comparing only the first 7 bytes.

bs_starts_with8

Determine if the remaining stream starts with $pattern, comparing only the first 8 bytes.

bs_starts_with9

Determine if the remaining stream starts with $pattern, comparing only the first 9 bytes.

is_alpha

Indicates that a byte is alphabetical.

is_control

Indicates that a byte is a control character.

is_digit

Indicates that a byte is a digit.

is_hex

Indicates that a byte is a hex character.

is_not_visible_7bit

Indicates that a byte is not a visible 7-bit character. Space are not considered visible.

is_not_visible_8bit

Indicates that a byte is not a visible 8-bit character. Space not considered visible.

is_visible_7bit

Indicates that a byte is a visible 7-bit character. Space is not considered visible.

is_visible_8bit

Indicates that a byte is a visible 8-bit character. Space is not considered visible.

Structs

ByteStream

Default byte stream type.