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_digits!

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.

bs_collect_hex!

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.

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_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, when $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_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.

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.