pub struct Bytes<'a> {
pub current_pos: usize,
pub current_byte: Option<&'a u8>,
pub buffer: Option<(usize, &'a [u8], Option<&'a u8>)>,
pub input: &'a [u8],
}
Fields§
§current_pos: usize
§current_byte: Option<&'a u8>
§buffer: Option<(usize, &'a [u8], Option<&'a u8>)>
§input: &'a [u8]
Implementations§
Source§impl<'a> Bytes<'a>
impl<'a> Bytes<'a>
pub const fn new(input: &'a [u8]) -> Self
pub fn advance(&mut self)
pub unsafe fn advance_by(&mut self, num: usize)
pub fn advance_to<F>(&mut self, delimiter: F) -> &'a [u8] ⓘ
pub fn buffered_advance_to<F>(&mut self, delimiter: F) -> &'a [u8] ⓘ
pub fn peek(&self, num: usize) -> Option<&[u8]>
pub fn get_remainder(&self) -> &[u8] ⓘ
pub unsafe fn get_remainder_str_unchecked(&self) -> &str
pub fn get_remainder_str(&self) -> Result<&str, ParseError>
pub fn get_current_str(&self, start: usize) -> Result<&str, Utf8Error>
pub fn finish(&mut self)
pub fn reset(&mut self, position: usize)
pub fn parse_digit(&mut self) -> Option<u8>
pub fn parse_digits_strip_zeros(&mut self) -> BytesRange
pub fn parse_digits(&mut self) -> BytesRange
Sourcepub fn parse_8_digits(&mut self) -> Option<u64>
pub fn parse_8_digits(&mut self) -> Option<u64>
This method is based on the work of Daniel Lemire and his blog post https://lemire.me/blog/2018/09/30/quickly-identifying-a-sequence-of-digits-in-a-string-of-characters/
pub fn next_is_ignore_ascii_case(&self, word: &[u8]) -> bool
pub const fn is_end_of_input(&self) -> bool
pub fn check_end_of_input(&self) -> Result<(), ParseError>
pub fn try_consume_delimiter( &mut self, delimiter: Delimiter, ) -> Result<(), ParseError>
Auto Trait Implementations§
impl<'a> Freeze for Bytes<'a>
impl<'a> RefUnwindSafe for Bytes<'a>
impl<'a> Send for Bytes<'a>
impl<'a> Sync for Bytes<'a>
impl<'a> Unpin for Bytes<'a>
impl<'a> UnwindSafe for Bytes<'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