pub struct ZeroToken<'a> {
pub token_type: ZeroTokenType<'a>,
pub start_position: Position,
pub end_position: Position,
}Expand description
Zero-copy token with position information
Fields§
§token_type: ZeroTokenType<'a>The type of token
start_position: PositionStarting position in the input
end_position: PositionEnding position in the input
Implementations§
Source§impl<'a> ZeroToken<'a>
impl<'a> ZeroToken<'a>
Sourcepub fn new(
token_type: ZeroTokenType<'a>,
start_position: Position,
end_position: Position,
) -> Self
pub fn new( token_type: ZeroTokenType<'a>, start_position: Position, end_position: Position, ) -> Self
Create a new zero-copy token
Sourcepub fn simple(token_type: ZeroTokenType<'a>, position: Position) -> Self
pub fn simple(token_type: ZeroTokenType<'a>, position: Position) -> Self
Create a simple token without data
Sourcepub fn into_owned(self) -> Token
pub fn into_owned(self) -> Token
Convert to owned token (for compatibility)
Trait Implementations§
impl<'a> StructuralPartialEq for ZeroToken<'a>
Auto Trait Implementations§
impl<'a> Freeze for ZeroToken<'a>
impl<'a> RefUnwindSafe for ZeroToken<'a>
impl<'a> Send for ZeroToken<'a>
impl<'a> Sync for ZeroToken<'a>
impl<'a> Unpin for ZeroToken<'a>
impl<'a> UnwindSafe for ZeroToken<'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