pub struct ParseContext<'src, 'cx, Cx: CxType> { /* private fields */ }
Implementations§
Source§impl<'src, const LA: usize> ParseContext<'src, 'static, CxTypeImpl<LA>>
impl<'src, const LA: usize> ParseContext<'src, 'static, CxTypeImpl<LA>>
pub fn new_with<R>( src: &'src str, f: impl FnOnce(ParseContext<'src, '_, CxTypeImpl<LA>>) -> R, ) -> (R, ParseError<'src>)
Source§impl<'src, 'cx, Cx: CxType> ParseContext<'src, 'cx, Cx>
impl<'src, 'cx, Cx: CxType> ParseContext<'src, 'cx, Cx>
pub fn by_ref<'this>(&'this mut self) -> ParseContext<'src, 'this, Cx>
pub fn should_discard(&self) -> bool
pub fn prefer_continue(&self) -> bool
pub fn update<'src2, 'cx2>(
self,
update: ParseContextUpdate<'src2, 'cx2, Cx>,
) -> ParseContext<'src2, 'cx2, Cx>where
'src: 'src2,
'cx: 'cx2,
pub fn discarding(self) -> Self
pub fn expecting(self, expected_parse: impl Into<Option<ExpectedParse>>) -> Self
pub fn src(&self) -> &'src str
pub fn error_mut(&mut self) -> &mut ParseError<'static>
pub fn location(&self) -> Location
pub fn set_location(&mut self, location: Location)
pub fn advance(&mut self)
pub fn look_ahead(&self) -> &TokenBuf<Cx::LookAhead>
pub fn look_ahead_mut(&mut self) -> &mut TokenBuf<Cx::LookAhead>
pub fn into_parts(self) -> ParseContextParts<'src, 'cx>
pub fn as_parts(&mut self) -> ParseContextParts<'src, '_>
pub fn pre_parse<'next, T: Rule>(
&mut self,
next: impl Into<Option<&'next RuleObject<'next, Cx>>> + 'next,
) -> RuleParseResult<()>where
Cx: 'next,
pub fn record_error<'next, T: Rule>(
&mut self,
next: impl Into<Option<&'next RuleObject<'next, Cx>>> + 'next,
) -> RuleParseResult<()>where
Cx: 'next,
pub fn error_at(&mut self, location: Location)
Trait Implementations§
Auto Trait Implementations§
impl<'src, 'cx, Cx> Freeze for ParseContext<'src, 'cx, Cx>where
Cx: Freeze,
impl<'src, 'cx, Cx> RefUnwindSafe for ParseContext<'src, 'cx, Cx>where
Cx: RefUnwindSafe,
<Cx as ContextType>::LookAhead: RefUnwindSafe,
impl<'src, 'cx, Cx> Send for ParseContext<'src, 'cx, Cx>
impl<'src, 'cx, Cx> Sync for ParseContext<'src, 'cx, Cx>
impl<'src, 'cx, Cx> Unpin for ParseContext<'src, 'cx, Cx>where
Cx: Unpin,
impl<'src, 'cx, Cx> !UnwindSafe for ParseContext<'src, 'cx, Cx>
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