pub struct Bytes<'a> {
pub exts: Extensions,
bytes: &'a [u8],
cursor: Position,
}
Fields§
§exts: Extensions
Bits set according to the Extensions
enum.
bytes: &'a [u8]
§cursor: Position
Implementations§
source§impl<'a> Bytes<'a>
impl<'a> Bytes<'a>
pub fn new(bytes: &'a [u8]) -> SpannedResult<Self>
pub fn span_error(&self, code: Error) -> SpannedError
pub fn advance(&mut self, bytes: usize) -> Result<()>
pub fn advance_single(&mut self) -> Result<()>
fn any_integer<T: Num>(&mut self, sign: i8) -> Result<T>
pub fn any_num(&mut self) -> Result<AnyNum>
pub fn bool(&mut self) -> Result<bool>
pub fn bytes(&self) -> &[u8] ⓘ
pub fn char(&mut self) -> Result<char>
pub fn comma(&mut self) -> Result<bool>
sourcepub fn check_ident(&mut self, ident: &str) -> bool
pub fn check_ident(&mut self, ident: &str) -> bool
Only returns true if the char after ident
cannot belong
to an identifier.
fn check_ident_other_char(&self, index: usize) -> bool
sourcepub fn check_tuple_struct(self) -> Result<bool>
pub fn check_tuple_struct(self) -> Result<bool>
Should only be used on a working copy
sourcepub fn consume_ident(&mut self, ident: &str) -> bool
pub fn consume_ident(&mut self, ident: &str) -> bool
Only returns true if the char after ident
cannot belong
to an identifier.
pub fn consume_struct_name(&mut self, ident: &'static str) -> Result<bool>
pub fn consume(&mut self, s: &str) -> bool
fn consume_all(&mut self, all: &[&str]) -> Result<bool>
pub fn eat_byte(&mut self) -> Result<u8>
pub fn expect_byte(&mut self, byte: u8, error: Error) -> Result<()>
sourcefn extensions(&mut self) -> Result<Extensions>
fn extensions(&mut self) -> Result<Extensions>
Returns the extensions bit mask.
pub fn float<T>(&mut self) -> Result<T>where
T: FromStr,
pub fn identifier(&mut self) -> Result<&'a [u8]>
pub fn next_bytes_contained_in(&self, allowed: fn(_: u8) -> bool) -> usize
pub fn next_bytes_is_float(&self) -> bool
pub fn skip_ws(&mut self) -> Result<()>
pub fn peek(&self) -> Option<u8>
pub fn peek_or_eof(&self) -> Result<u8>
pub fn signed_integer<T>(&mut self) -> Result<T>where
T: Num,
pub fn string(&mut self) -> Result<ParsedStr<'a>>
fn escaped_string(&mut self) -> Result<ParsedStr<'a>>
fn raw_string(&mut self) -> Result<ParsedStr<'a>>
fn test_for(&self, s: &str) -> bool
pub fn unsigned_integer<T: Num>(&mut self) -> Result<T>
fn decode_ascii_escape(&mut self) -> Result<u8>
fn decode_hex(&self, c: u8) -> Result<u8>
fn parse_escape(&mut self) -> Result<char>
fn skip_comment(&mut self) -> Result<bool>
Trait Implementations§
impl<'a> Copy for Bytes<'a>
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