pub struct LexedSource<'source> { /* private fields */ }Expand description
Guarded source lexed on its existing scoped worker, before syntax parsing.
Private fields bind the path, ignored header and original native tokens.
The ticket is available only inside PreparedSource::with_lexed. Its
consuming parse methods use that same stream on the current worker; they
perform no additional guard scan, lex or worker startup.
Implementations§
Source§impl<'source> LexedSource<'source>
impl<'source> LexedSource<'source>
Sourcepub const fn tokens(&self) -> &TokenStream
pub const fn tokens(&self) -> &TokenStream
Borrow the original tokens before the native syntax parser starts.
Cloning or iterating native tokens can allocate. Callers must admit measurement itself before using this view to admit later parser work.
Sourcepub fn parse_with_tokens<R>(
self,
visit: impl FnOnce(&File, TokenStream) -> R,
) -> Result<R, LoadError>
pub fn parse_with_tokens<R>( self, visit: impl FnOnce(&File, TokenStream) -> R, ) -> Result<R, LoadError>
Trait Implementations§
Auto Trait Implementations§
impl<'source> !Send for LexedSource<'source>
impl<'source> !Sync for LexedSource<'source>
impl<'source> Forget for LexedSource<'source>
impl<'source> Freeze for LexedSource<'source>
impl<'source> Move for LexedSource<'source>
impl<'source> RefUnwindSafe for LexedSource<'source>
impl<'source> Unpin for LexedSource<'source>
impl<'source> UnsafeUnpin for LexedSource<'source>
impl<'source> UnwindSafe for LexedSource<'source>
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more