Macro byte_slice::bs_collect_length [] [src]

macro_rules! bs_collect_length {
    ($context:expr, $length:expr, $on_byte:expr, $on_eos:expr) => { ... };
    ($context:expr, $length:expr) => { ... };
}

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.

When $on_byte and $on_eos are not supplied, this macro assumes that $length bytes are available for reading, and immediately advances the $context.stream_index by $length bytes.