pub enum Buffer {
MultiByte(Vec<u8>),
Span(Span),
}
Expand description
Representation of a buffer containing items making up a Token
.
It’s either always Span
, or one of the *Byte
variants.
Variants§
MultiByte(Vec<u8>)
Multiple bytes making up a token. Only set for TokenType::String
and
TokenType::Number
.
Span(Span)
The span allows to reference back into the source byte stream
to obtain the string making up the token.
Please note that for control characters, booleans and null (i.e
anything that is not Buffer::MultiByte
you should use
<TokenType as AsRef<str>>::as_ref()
)
Trait Implementations§
impl StructuralPartialEq for Buffer
Auto Trait Implementations§
impl Freeze for Buffer
impl RefUnwindSafe for Buffer
impl Send for Buffer
impl Sync for Buffer
impl Unpin for Buffer
impl UnwindSafe for Buffer
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