pub struct Tokenizer<'a> { /* private fields */ }Expand description
Zero-copy tokenizer
Implementations§
Source§impl<'a> Tokenizer<'a>
impl<'a> Tokenizer<'a>
Sourcepub fn skip_whitespace(&mut self)
pub fn skip_whitespace(&mut self)
Skip whitespace (space and tab only, not newlines)
Sourcepub fn read_until(&mut self, delim: u8) -> &'a [u8] ⓘ
pub fn read_until(&mut self, delim: u8) -> &'a [u8] ⓘ
Read until delimiter using SIMD search
Sourcepub fn read_until_any(&mut self, delims: &[u8]) -> &'a [u8] ⓘ
pub fn read_until_any(&mut self, delims: &[u8]) -> &'a [u8] ⓘ
Read until any of the delimiters
Sourcepub fn read_ident(&mut self) -> &'a [u8] ⓘ
pub fn read_ident(&mut self) -> &'a [u8] ⓘ
Read identifier (alphanumeric + underscore)
Sourcepub fn read_number(&mut self) -> Result<Token<'a>>
pub fn read_number(&mut self) -> Result<Token<'a>>
Read number (int or float)
Sourcepub fn read_string_vacuum(&mut self, next_is_number: bool) -> &'a [u8] ⓘ
pub fn read_string_vacuum(&mut self, next_is_number: bool) -> &'a [u8] ⓘ
Read string value using vacuum parsing Reads until the next expected type based on schema
Sourcepub fn read_string_validated(&mut self, next_is_number: bool) -> Result<&'a str>
pub fn read_string_validated(&mut self, next_is_number: bool) -> Result<&'a str>
Read string value with UTF-8 validation Returns an error if the string contains invalid UTF-8
Sourcepub fn read_ident_validated(&mut self) -> Result<&'a str>
pub fn read_ident_validated(&mut self) -> Result<&'a str>
Read identifier with UTF-8 validation
Sourcepub fn next_token(&mut self) -> Result<Token<'a>>
pub fn next_token(&mut self) -> Result<Token<'a>>
Get next token
Sourcepub fn peek_token(&self) -> Result<Token<'a>>
pub fn peek_token(&self) -> Result<Token<'a>>
Peek next token without consuming
Auto Trait Implementations§
impl<'a> Freeze for Tokenizer<'a>
impl<'a> RefUnwindSafe for Tokenizer<'a>
impl<'a> Send for Tokenizer<'a>
impl<'a> Sync for Tokenizer<'a>
impl<'a> Unpin for Tokenizer<'a>
impl<'a> UnsafeUnpin for Tokenizer<'a>
impl<'a> UnwindSafe for Tokenizer<'a>
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.