pub struct TokenWithPosition {
pub token: Token,
pub start_pos: Position,
pub end_pos: Position,
}Expand description
Token with full position information
Fields§
§token: TokenThe original token
start_pos: PositionStart position with line/column
end_pos: PositionEnd position with line/column
Implementations§
Source§impl TokenWithPosition
impl TokenWithPosition
Sourcepub fn new(
token: Token,
start_pos: Position,
end_pos: Position,
) -> TokenWithPosition
pub fn new( token: Token, start_pos: Position, end_pos: Position, ) -> TokenWithPosition
Create a new token with position
Sourcepub fn byte_range(&self) -> (usize, usize)
pub fn byte_range(&self) -> (usize, usize)
Get byte range
Trait Implementations§
Source§impl Clone for TokenWithPosition
impl Clone for TokenWithPosition
Source§fn clone(&self) -> TokenWithPosition
fn clone(&self) -> TokenWithPosition
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TokenWithPosition
impl RefUnwindSafe for TokenWithPosition
impl Send for TokenWithPosition
impl Sync for TokenWithPosition
impl Unpin for TokenWithPosition
impl UnsafeUnpin for TokenWithPosition
impl UnwindSafe for TokenWithPosition
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