Module stream

Source
Expand description

Stream capability for combinators to parse

Stream types include:

  • &[u8] and Bytes for binary data
  • &str (aliased as Str) and BStr for UTF-8 data
  • LocatingSlice can track the location within the original buffer to report spans
  • Stateful to thread global state through your parsers
  • Partial can mark an input as partial buffer that is being streamed into
  • [Custom stream types][crate::_topic::stream]

Modulesยง

bstr ๐Ÿ”’
bytes ๐Ÿ”’
locating ๐Ÿ”’
partial ๐Ÿ”’
range ๐Ÿ”’
stateful ๐Ÿ”’
token ๐Ÿ”’

Macrosยง

impl_contains_token_for_tuple ๐Ÿ”’
impl_contains_token_for_tuples ๐Ÿ”’

Structsยง

BStr
Improved Debug experience for &[u8] UTF-8-ish streams
BitOffsets
Iterator for bit stream ((I, usize))
Bytes
Improved Debug experience for &[u8] byte streams
Checkpoint
Ensure checkpoint details are kept private
LocatingSlice
Allow collecting the span of a parsed token within a slice
Partial
Mark the input as a partial buffer for streaming input.
Range
A range bounded inclusively for counting parses performed
Stateful
Thread global state through your parsers
TokenSlice
Specialized input for parsing lexed tokens

Enumsยง

CompareResult
Result of Compare::compare

Traitsยง

Accumulate
Abstracts something which can extend an Extend. Used to build modified input slices in escaped_transform
AsBStr
Helper trait for types that can be viewed as a byte slice
AsBytes
Helper trait for types that can be viewed as a byte slice
AsChar
Transforms a token into a char for basic string parsing
Compare
Abstracts comparison operations
ContainsToken
Check if a token is in a set of possible tokens
FindSlice
Look for a slice in self
Location
Current parse locations offset
Offset
Useful functions to calculate the offset between slices and show a hexdump of a slice
ParseSlice
Used to integrate strโ€™s parse() method
SliceLen
Abstract method to calculate the input length
Stream
Core definition for parser input state
StreamIsPartial
Marks the input as being the complete buffer or a partial buffer for streaming input
ToUsize
Helper trait to convert numbers to usize.
UpdateSlice
Convert a Stream into an appropriate Output type

Functionsยง

clamp_capacity ๐Ÿ”’
memchr ๐Ÿ”’
memchr2 ๐Ÿ”’
memchr3 ๐Ÿ”’
memmem ๐Ÿ”’
memmem2 ๐Ÿ”’
memmem3 ๐Ÿ”’
memmem2_ ๐Ÿ”’
memmem3_ ๐Ÿ”’
memmem_ ๐Ÿ”’
next_bit ๐Ÿ”’
peek_bit ๐Ÿ”’

Type Aliasesยง

Str
UTF-8 Stream