pub struct ByteStream<'a> {
pub byte: u8,
pub mark_index: usize,
pub stream: &'a [u8],
pub stream_index: usize,
}
Expand description
Default byte stream type.
All stream macros will accept any struct given as $context
, as long as they contain the
following four fields:
byte
(u8) The most recent byte.mark_index
(usize) Starting index of a collection of marked bytes.stream
(&u8) Stream of bytes.stream_index
(usize) Current stream index.
Fields§
§byte: u8
Current byte.
mark_index: usize
Mark index.
stream: &'a [u8]
Stream data.
stream_index: usize
Stream index.
Implementations§
Source§impl<'a> ByteStream<'a>
impl<'a> ByteStream<'a>
Sourcepub fn new(stream: &'a [u8]) -> ByteStream<'a>
pub fn new(stream: &'a [u8]) -> ByteStream<'a>
Create a new ByteStream
.
Trait Implementations§
Source§impl<'a> Debug for ByteStream<'a>
impl<'a> Debug for ByteStream<'a>
Auto Trait Implementations§
impl<'a> Freeze for ByteStream<'a>
impl<'a> RefUnwindSafe for ByteStream<'a>
impl<'a> Send for ByteStream<'a>
impl<'a> Sync for ByteStream<'a>
impl<'a> Unpin for ByteStream<'a>
impl<'a> UnwindSafe for ByteStream<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more